Visible elements in a viewport

Visible elements in a viewport

Bruno_Neves_Pires_Silva
Advocate Advocate
653 Views
1 Reply
Message 1 of 2

Visible elements in a viewport

Bruno_Neves_Pires_Silva
Advocate
Advocate

How can I get the visible elements in a viewport ?

 

I Tryied using  FilteredElementCollector(doc, viewId), like suggested here (https://forums.autodesk.com/t5/revit-api-forum/get-elementid-of-all-visible-entities-in-a-viewport/m...),  but its returning much more elements than are really visible.

 

 I Tryied view.CropBox, but its not working  properly too..

 

Thank you in advance…

0 Likes
654 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Actually, you can't. A viewport will show everything that is within it's range. So it may look the collector is giving you to much objects, but in reality it isn't.  So lets say you have a big cube and behind it a small cube. Both are within the range of the view. You place the view on a sheet and set it on front view. The view will show both cubes, only you won't see the small cube, since the big one is in front of it. So the collector will tell you there are 2 objects visible in this view, because the collector can't know the big cube is hiding the smaller one.