Getting Rotation Value From Rotate Tool
-
Hi,
I'm having trouble obtaining a angle value for how much a group is rotated when the user uses the Rotate Tool. The Group is 2D sitting in the x and y plane and I would like to find out how much it is rotated about an axis at the center of the group in the z direction. From reading through the forums, I know you cannot directly obtain information from the built-in Rotate Tool, but I was hoping there would be an easy work around that compares the starting orientation with the ending orientation. I'm still new to Ruby and Sketchup so apologies if there is a simple solution I'm missing.
Thanks in advanced.
-
- Select the group instance
- Open the Ruby Console
- In the console type:
sel = Sketchup;;active_model.selection g = sel[0] a = X_AXIS.angle_between(g.transformation.xaxis)
The angle will be in radians.
To display degrees:
a.radians
-
@dan rathbun said:
- Select the group instance
- Open the Ruby Console
- In the console type:
> sel = Sketchup;;active_model.selection > g = sel[0] > a = X_AXIS.angle_between(g.transformation.xaxis) >
The angle will be in radians.
To display degrees:
> a.radians >
Thank you! Exactly what I needed!
-
@kayeee said:
Thank you! Exactly what I needed!
To see how to wrap that up into a macro file, look at the sample I posted here:
forums.sketchup: [Code] Determining Angle Between View and Model’s Axes
Advertisement