How to create a Bounding Box for visible elements only?

How to create a Bounding Box for visible elements only?

Antonio.VachevIPA
Observer Observer
1,039 Views
3 Replies
Message 1 of 4

How to create a Bounding Box for visible elements only?

Antonio.VachevIPA
Observer
Observer

I have a Revit family where certain elements of it do not appear in "Coarse" and "Medium" Detail Levels. I need to create a Bounding Box of only the visible elements, but whenever I try I can only get it for the whole element, even though parts of it are not visible in the specific view.

 

On the screenshot below, the upper element is a generic annotation and the bottom element is actual 3D Geometry. I have situations where the upper element is also a Detail Item, all nested in the family.

AntonioVachevIPA_0-1660114411712.png

This is what it looks like in "Course" Detail Level (no 3D geometry visible):

AntonioVachevIPA_1-1660114962511.png

Essentially, what I am trying to do is arrange the symbols in a legend and I need to know the height of the visible elements only, hence the bounding box. Any suggestions are very much appreciated!

 

Thanks,

A

 

0 Likes
1,040 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

You can specify a view argument to the bounding box property:

 

https://www.revitapidocs.com/2023/def2f9f2-b23a-bcea-43a3-e6de41b014c8.htm

 

I would assume that the view's detail level setting is respected by that method.

  

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

Antonio.VachevIPA
Observer
Observer

Thanks for the reply, Jeremy. I've tried some nodes within Dynamo that ask for the View, but that does not have any effect on the bbox in terms of ignoring invisible elements in the instance. Following the link you sent, I read this:

 

"Also note that this bounding box volume may enclose geometry that is not obvious. For example, the "flip controls" that could be part of a family will be included in the computation of the bounding box even though they are not always visible in the family instance of the family."

 

I will give it a try anyways and let you know. Thanks.

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni

Yes, I was afraid of that. The Revit Element bounding box can be used for quick element filtering, which means that it is available for searching the database without loading the entire element definition into memory. That gives me the impression that it is precomputed and stored in the element header data, in which case it will be one size fits all.

  

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