Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
rita.aguiar
6155 Views, 3 Replies

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

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

3 REPLIES 3
Message 2 of 4
BardiaJahan
in reply to: rita.aguiar

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
in reply to: BardiaJahan

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?

Message 4 of 4
FAIR59
in reply to: rita.aguiar

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report