Oriented boundingbox with instance axes

Hello everyone and best wishes for the New Year.

I have a component instance selected and wanted to get the coordinates of its boundingbox.
The axes of the instance are not the same as the axes of the model. Sketchup correctly displays a boundingbox oriented on the axes of the instance and not on the axes of the model.
But in ruby I get the coordinates of a boundinbox but oriented on the axes of the model and not on the axes of the instance.
How to get an instance axis oriented boundingbox via API
Thanks in advance.

You need to get the instances’s definition bounding box. Given a variable “comp_inst” that references the desired instance:

local_bbox = comp_inst.definition.bounds

Now the API for a ComponentDefinition object doesn’t include a bounds method, but it inherits it from the Drawingelement class.

2 Likes

Thank you Bruce
It’s work nice!
I was far away to imagine that the solute will be via definition
Have a nice day