Wish: Expanded functionality for "BoundingBox"

I was wondering is there a way to select, say, 100 models and apply “BoundingBox” to all of them simultaneously, with an option in the command line that allows to put a bounding box to each one of them individually? The default behaviour of the command is to set a single bounding box to all selected objects.

Also, another improvement would be to be able to replace the box output with a Centered line oriented in the desired direction (X, Y, Z). That would help with projects where the intent is to calculate the total length of pipes or other objects.
Rhino already has an option “Outpur=Curves” to create a bounding box consisting 6 groupped closed rectangular polylines, but they are not convenient for calculation of the length of multiple objects at once.

Notice the line in the middle of the pipe that could be an alternative to the box:

Hello - BoundingBox in V7/WIP has a ‘Cumulative=Yes/No’ option.

-Pascal

1 Like

That’s great. :slight_smile: Thank you for the quick response! :slight_smile:

If you want something that works in V6, here’s something I concocted awhile back…

AddBBForEach.py (3.7 KB)

If you don’t preselect objects, there are some command line options.

I tried it but it creates 12 separate curves that together form a box, as opposed to the 6 groupped rectangles that the default “BoundinBox” command creates. As far as I can see, it does not create a single centered line that represents the length of the object.
I noticed that your script groups the curves if “MatchInputObjectAttributies” is set to “No”, but will leave the curves ungroupped if you set “Yes”. Interesting.

Yes, I found that preferable, as there are no duplicate curves when exploding.

That is probably an oversight.