Thijser
Thijser

Reputation: 2633

Is there any way to clone a document in revit

I'm working on a revit project where we want to clone a document for multithreading purposes. However there does not appear to be any way to clone a document by default. There does not appear to be a Document.clone() function.

Ultimately I'm looking for something that allows me to create a clone that at least copies the location of all elements, Rooms, levels and related data but does not have to copy the 3D models of objects (although it's not a problem if it does).

Extending document and calling memberwise clone creates a shallow clone. The Document class is also going to contain cycling relations (host vs hostee)

Upvotes: 0

Views: 101

Answers (1)

Deleted
Deleted

Reputation: 81

It sounds like you may want to start by looking into the FilteredElementCollector class. This is has been, in my mind anyway, the default way to get whatever you need from a currently existing Document file. I suggest starting your search with the following and see if that works for you

        FilteredElementCollector coll =
            new FilteredElementCollector(doc).WhereElementIsNotElementType();

Here is a site that has documentation on the FilteredElementCollector, along with the Revit API as a whole - http://www.revitapidocs.com/2015/263cf06b-98be-6f91-c4da-fb47d01688f3.htm

Upvotes: 1

Related Questions