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: 

Difference between two FilteredElementCollector-s

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
1076 Views, 3 Replies

Difference between two FilteredElementCollector-s

Hi. I am new to Revit API. In many examles of code with filtering of elements that i saw there was a code like:

FilteredElementCollector f1 = new FilteredElementCollector(CurrentRevitDocument).OfClass(typeof(FamilyInstance)).OfCategory(CATEGORY_HERE);
FilteredElementCollector f2 = new FilteredElementCollector(CurrentRevitDocument).OfCategory(CATEGORY_HERE);

I know about categories, types and so on but I can not understand, for examle

1. What is the difference in f1 and f2, f1 don't have family symbols in it or what?

2. How does work differ with these collectors?

3. Can you please give me the examle of correct code for filterring all elements in the revit part using, for examle, foreach cycle with BuiltInCategory, for better understanding?

Thanks for any help.

3 REPLIES 3
Message 2 of 4
jeremytammik
in reply to: Anonymous

The filtered element collector class itself does provide some Boolean methods.

 

You can also limit the set of input elements by passing in a list of element ids.

 

For numerous in-depth discussions of filtered element collector usage, please refer to the corresponding topic group shared by The Building Coder:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9

 

For many more examples, look at The Building Coder samples, and especially its module CmdCollectorPerformance.cs:

 

https://github.com/jeremytammik/the_building_coder_samples

 

https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/C...

 

That should provide all you need and more.

 

Cheers,

 

Jeremy

 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 4
jeremytammik
in reply to: Anonymous

Oh, your question maybe has less to with the API than a basic understanding of underlying Revit principles.

  

Before looking further into your question from the API point of view, please learn and understand the difference and relationships between Revit:

 

  • Family definitions, standard and system
  • Family symbols or types, which may actually be WallType or similar in the case of system families
  • Family instances, which may actually be Wall or other specific elements in the case of system families

 

I hope this clarifies.

 

Thank about it and you will be able to answer your question yourself, and many others besides.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 4
Anonymous
in reply to: jeremytammik

Thank you for your reply.

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

Post to forums  

Autodesk Customer Advisory Groups


Rail Community