Bounding box
-
When a component is selected, a blue box surrounds it's geometry, one corner of which is its axis. When I rotate the component, the blue box and axis rotates. The api makes reference to a BoundingBox (BB), but the documentation states that the BB is in reference to the world axis (as I have verified), not the component's blue box that rotates along with the component. Can anyone explain how I can access information regarding the axis of the blue box? Specifically, so that I can rotate the component on its axis origin along the z axis.
-
When you do:
my_component.transformation.bounds
you get the bounding box based on real world coordinates. So instead, use:
my_component.definition.transformation.bounds
and that will get the bounding box for the non-rotated component. Or if you have a group, which does not have a definition, you can use this method:
my_group.local_bounds
to get the local bounding box for the group.
But your question is about the component axis, and you really don't need the bounding box for that. To get the component Instance bounding box, you can get it with:
my_component.transformation.xaxis (or yaxis, zaxis).
So if you want to rotate around the local z axis, use that method. Hope that helps,
Chris
-
Hi Chris, Thanks for pointing me in the right direction. This:
if i.definition.name == e.definition.name bondingbox = i.definition.bounds puts bondingbox.height #my code will go here end
Did it for me:-) Even if this is not what I need to rotate the component, its good to learn anything.
-
Moved the thread to the Developer's forum. We have reorganized so that the Plugin section is only a list of plugins you can download and use.
Advertisement