PDA

View Full Version : Get all drawed elements in a Document



Pierre-Nelson NAVARRA
2008-06-25, 04:10 PM
Hi,
I've got a project with elements and a linked revit file
I do a selection
I'd like to get all elements of the linked file
I do this
I make a foreach of elements in activedocument.selection.elements
When I got the object wich is the linked element, I get the Document associated.
I compare TitleName of project and I'm obliged to get all documents loaded to get the document linked.
I do this...

DocumentSet m_document = m_revit.Documents;
foreach (Document document in m_document)
{
ElementIterator itor = document.Elements;
while (itor.MoveNext())
{
Autodesk.Revit.Element element = itor.Current as Autodesk.Revit.Element;
// blablabla
}
}

The problem is : how to get only elements like doors, windows, tag, and not units, etc.....??

Am I clear?:cry: