Get bounding box from solid of a structural column is not accurate

Get bounding box from solid of a structural column is not accurate

heziTYJKR
Contributor Contributor
873 Views
4 Replies
Message 1 of 5

Get bounding box from solid of a structural column is not accurate

heziTYJKR
Contributor
Contributor

Hi everyone,

I have an issue getting an accurate bounding box from a solid of structural columns only.

Following is an example of a few elements and the bounding box that was created from them (the bounding box is yellow):

Structural Column extrusion (you can see that the yellow bounding box is larger than the actual column):

heziTYJKR_0-1652965658178.png

A structural column with blend shape (this one is also inaccurate):

heziTYJKR_1-1652965755635.png

And just to check that it is not happening to any direct shape, I tried getting a bounding box for extrusion of structural framing and I got an accurate result:

heziTYJKR_2-1652965855914.png

So in other words: getting a bounding box from solid works for many kinds of shapes except for a shape created as part of a structural column.

Note: if I get a bounding box for those shapes using get_boundingbox(null) method then it works, but we want to have a unified and more accurate method for all the elements to obtain an accurate bounding box from the solid.

 

Thanks

874 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

I do not see the inaccuracy that you describe. Is my eyesight poor, or is the inaccuracy pretty small?

 

Remember: a bounding box is a bounding box. There is no guarantee that a bounding box is minimal. Never.

 

The main purpose of a bounding box is speed, not accuracy, and definitely not to be minimal.

  

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

heziTYJKR
Contributor
Contributor

Let me present it in more details, the red area is the difference between the received bounding box and the actual element:

heziTYJKR_0-1652984340411.png

It is 1/16" and it has an effect on our tools.

We need a precise accuracy and we do get it in most of the cases and this is the reason that we use the solid and not just the original get_boundingbox method.

The fact that it works for other kinds of direct shapes proves that something is wrong in this specific case.

0 Likes
Message 4 of 5

jeremy_tammik
Alumni
Alumni

When you say "bounding box", I assume that you are using the Element BoundingBox property, i.e.., get_BoundingBox.

 

What issues is this causing?

  

As said, you can never assume that a bounding box is minimal, so, if this is causing an issue with your tools, I would recommend checking whether they are erroneously making this assumption. If they are, it might be safer to fix them.

  

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

heziTYJKR
Contributor
Contributor

When I say bounding box in the specific case of the solid, this is what I mean:

https://www.revitapidocs.com/2015/716fecd9-7d09-fa61-5c02-de714259a214.htm

 

The goal is to get a minimal bounding box and this is why we are working with the solid.

As I said, in most cases, it works.

 

After further investigation, we discovered that this happens if at least one of the corners is round.

I hope this also helps.

0 Likes