When you insert a component it is placed at a particular place. And you can rotate it. How can I find the coordinates of its location and angle of rotation?
I assume the coordinates of the component give the position of the component’s axes origin? And that the rotation is how much the component’s axes are rotated with respect to the model axes?
There’s nothing in the native tools…
But, you can do in the Ruby API, thus:
Get a reference to the component instance some way…
Here by selection…
instance = Sketchup.active_model.selection[0]
tr = instance.transformation
point = tr.origin
and for the rotation you need to have the su_dynamiccomponents
extension loaded [it is by default]…
rotx = tr.rotx.radians
gives the X axial rotation in degrees - and the equivalents for roty
, rotz
etc…
Thanks.
I haven’t worked with Ruby for a long time. I’ll give it a try.