Is there a way how I can check if document has any hidden elements?

Is there a way how I can check if document has any hidden elements?

oleksandr.nistratov
Explorer Explorer
291 Views
2 Replies
Message 1 of 3

Is there a way how I can check if document has any hidden elements?

oleksandr.nistratov
Explorer
Explorer

Is there a way how I can check if document has any hidden elements without getting them using FilteredElementCollector.

0 Likes
292 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

In the Revit API, a filtered element collector is almost the only way to access elements at all, if you do not have the element id or its unique id already available. So, probably, the answer is no.

 

Unless, of course, you store some element ids in your add-in data and then explicitly hide those elements  🙂

  

Why in heaven's name would you want to avoid using a filtered element collector?

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

oleksandr.nistratov
Explorer
Explorer

The main idea was check if there is any hidden elements before using filtered element collector to get those elements. 

For projects with a large number of elements, this may take some time, and it would be a good idea to avoid trying to retrieve hidden elements if there are no hidden elements.😀

0 Likes