Is there a FilteredElementCollector Method to get all modeled elements Revit?

Is there a FilteredElementCollector Method to get all modeled elements Revit?

rita.aguiar
Advocate Advocate
6,518 Views
3 Replies
Message 1 of 4

Is there a FilteredElementCollector Method to get all modeled elements Revit?

rita.aguiar
Advocate
Advocate

By modeled elements I mean I want to get all elements for construction such as walls, beams, foundations, windows, doors, ducts, etc. This is to later use all these elements to create a map of quantities of the elements for construction.

 

I have tried:

 

 

FilteredElementCollector collector = new FilteredElementCollector(doc);
collector.WhereElementIsNotElementType().OfClass(typeof(FamilyInstance));

 

 

But strangely I am not obtaining any elements.

 

Any help would be appretiated

Accepted solutions (1)
6,519 Views
3 Replies
Replies (3)
Message 2 of 4

BardiaJahan
Advocate
Advocate

FamilyInstance objects are only for the custom families (i.e. Furniture, Beams, etc) and not the system families (i.e. Wall, Floor, etc.)

For what you are trying to retrieve, I would use the following:

 

FilteredElementCollector collector = new FilteredElementCollector(doc);
collector.WhereElementIsNotElementType().WhereElementIsViewIndependent();

This will exclude all element types (Wall Types as opposed to actual Walls) and view-specific elements (annotations, etc.)

Message 3 of 4

rita.aguiar
Advocate
Advocate

Thank you for your help @BardiaJahan!

 

But this filter still retrieves too many elements (4936).

Is there a way I can only retrieve the constructed elements?

0 Likes
Message 4 of 4

FAIR59
Advisor
Advisor
Accepted solution