• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Getting Rotation Value From Rotate Tool

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 2 Posters 308 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    kayeee
    last edited by 22 Apr 2015, 03:43

    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.

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dan Rathbun
      last edited by 22 Apr 2015, 16:51

      1. Select the group instance
      2. Open the Ruby Console
      3. 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
      
      

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • K Offline
        kayeee
        last edited by 23 Apr 2015, 01:12

        @dan rathbun said:

        1. Select the group instance
        1. Open the Ruby Console
        2. 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!

        1 Reply Last reply Reply Quote 0
        • D Offline
          Dan Rathbun
          last edited by 23 Apr 2015, 18:11

          @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

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            1/4
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement