• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Reset/zero transformation, scale and rotation

Scheduled Pinned Locked Moved Plugins
7 Posts 6 Posters 3.9k Views
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.
  • P Offline
    Pixero
    last edited by 30 Oct 2015, 15:01

    Is there a plugin to reset the transformation, scale and rotation of a component?

    1 Reply Last reply Reply Quote 0
    • J Offline
      JQL
      last edited by 30 Oct 2015, 15:15

      Right click menu?

      Reset Scale and Reset Skew.

      Rotation is harder but if you use the move tool without selecting the component you find the red dot dongles and you can rotate to 0.

      www.casca.pt
      Visit us on facebook!

      1 Reply Last reply Reply Quote 0
      • S Offline
        sdmitch
        last edited by 30 Oct 2015, 17:14

        @pixero said:

        Is there a plugin to reset the transformation, scale and rotation of a component?

        Maybe this

        unless file_loaded?((__FILE__))
        	UI.add_context_menu_handler do |menu|
        		sel = Sketchup.active_model.selection
        		if sel.first.is_a? Sketchup;;ComponentInstance
        			menu.add_separator
        			menu.add_item('Reset Scale Rotation') {
        				mod = Sketchup.active_model
        				ent = mod.entities
        				mod.start_operation 'Reset Scale Rotation'
        				cmp=sel.first;org=cmp.transformation.origin
        				t=cmp.transformation.to_a
        				t[0]=1;t[1]=0;t[2]=0;#t[3]=nil
        				t[4]=0;t[5]=1;t[6]=0;#t[7]=nil
        				t[8]=0;t[9]=0;t[10]=1;#t[11]=nil
        				t[12]=org.x;t[13]=org.y;t[14]=org.z;#t[15]=nil
        				cmp.transformation=cmp.transformation.set! t
        				mod.commit_operation
        			}
        		end
        	end
        	file_loaded((__FILE__))
        end
        
        

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • P Offline
          Pixero
          last edited by 31 Oct 2015, 08:38

          Thanks, will try this. 👍

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by 31 Oct 2015, 09:02

            Another option would be to set the Transformation to IDENTITY.

            instance.transformation = IDENTITY

            This would also move the instance to the Origin, but it's easy to move it back if that's what you need.

            Hi

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 31 Oct 2015, 16:16

              Alternatively, could you perhaps reset the object's transformation back to the inverse of what it was ?

              obj.transform!(obj.transformation.inverse)

              TIG

              1 Reply Last reply Reply Quote 0
              • G Offline
                galinette
                last edited by 27 Jun 2016, 16:51

                Alternatively, you can delete that component instance, and create a new one with the components window. It will have an identity rotation/scale, just place it on the origin.

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

                Advertisement