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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement