Help, difference in height length and width of a comparible boundingbox

Hey, Im looking for some help/advice for getting the width, Length and Height of an 3d Bounding box, but i have trouble with it because the bounding boxes should be displaying the exact same information, but it is displaying the length and width of the bounding box as if they are Flipped. I know it is because the bounding box is in a different position and at a different angle. is there any way to fix this problem? I need it beacose i want to calculate the total length of all the bounding boxes combined

[edit]
I have found a way around it but am not totaly happy with it bc this assumes that the longest side = length while this does not need to be true.


What is true is that the width of the element is always the same while the length is a variable but i dont know how to filter that in a correct way.

Bounding boxes are globally oriented while elements are not. In order to match the element width with the bounding box equivalent width you’d have to get the orientation of the element to know which way it faces. Then you’d know whether the oriented width of the element is equal to the “un-oriented” width of the bounding box or the “un-oriented” length.

Keep in mind, this only works for elements that are oriented along the major axes. If your element is at a 45 degree angle, for example, the bounding box wouldn’t match the orientation of the element in any direction.

What is it exactly that you’re trying to accomplish here? Bounding boxes may not be the way to go.

Ah yes forgot about that problem indeed.

I am making a tool that can detect all connections of an elements and how long the connection is. For example i wanna know how long the Fire-resistant sealing is between a door and a fire rated wall, and yes i know u can do it by giving the door the fire rating fam and calculating the total. but that is not what i want to do. U have situations where u get a drawing of somebody else and they used the same family everywhere so u can do it by hand selecting all doors and giving them fire rating, while the tool just looks at how they are connected if they connected to a concrete wall the door is fire rated that means that the door connects with the wall on 3 side’s (2 sides and 1 top) u sum it up and u get the length of the material for the connection u need. I hope i explained it well enough.

[Edit]
I have found a way around the problem with the 45 degree angle’s i am first puting a solid.byunion to get the length hieght and width of the element before making the scope box and than later in the script filtering them so it only adds the side’s that have the same connection. But the same problem still exist that it doesn’t understand what side is where.

Wouldn’t you also be able to get those values directly from the door parameters (width and height)? There are always going to be edge cases where the architect does something funny and doesn’t match the standard process, but using geometry can also cause inaccuracies. If the family includes a jam or trim or anything else that extends beyond the fire rated portion of the door then your values are off.

If you’re set on getting the geometric door width you could intersect the door geometry with the room bounding curves to get the door “curve” and it’s length.

Getting the bounding box of the geometry translated to the origin would also work. Get the transform of the family instance, invert that coordinate system, and then get the bounding box. Min point would almost always be in -X-Y and max point in +X +Y if done right. The vector between those two points would give the height (Z component) and the width (X component).

1 Like