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

Move instances softly, using the mouse

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 2 Posters 261 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.
  • D Offline
    dacastror
    last edited by 11 Apr 2014, 19:20

    hi all, I'm trying to make a tool to move groups, similar to the native tool of sketchup, but so far I'm starting, I wrote the following code and I do not know why the group does not move smoothly

    
    #before beginning must have a selected group
    
    class MoveGroup
       def onMouseMove flags, x, y, view
          mod = Sketchup.active_model
          sel = mod.selection.to_a[0]
          input = view.inputpoint x,y
          p = input.position
          tr = Geom;;Transformation.translation p
          sel.move!(tr) if sel.is_a?(Sketchup;;Group)
          view.refresh
       end
    end
    
    Sketchup.active_model.select_tool MoveGroup.new
    
    
    

    in advance I appreciate your help (Google translator)

    1 Reply Last reply Reply Quote 0
    • D Offline
      driven
      last edited by 11 Apr 2014, 20:26

      hi

      it jumps about because it doesn't know where in 3d space the mouse is...

      when you lock onto an axis it's fine

      try using arrow keys as a modifier...

      john

      learn from the mistakes of others, you may not live long enough to make them all yourself...

      1 Reply Last reply Reply Quote 0
      • D Offline
        dacastror
        last edited by 12 Apr 2014, 17:05

        thank you very much, is what I needed to know 😄
        by the way, I wanted to look at your plugins and I did not find them, look in the pluginstore and select search by author...

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by 12 Apr 2014, 21:02

          @dacastror said:

          ... I wanted to look at your plugins and I did not find them, look in the pluginstore and select search by author...

          you won't find them, there's a couple on limited beta release and a few of mac only dev tools that almost no-one else has even seen...
          I keep adding to them on the day I decide to release, then I want to test again, ect... etc...
          I PM the closest to release one if you want to comment on it...
          john

          learn from the mistakes of others, you may not live long enough to make them all yourself...

          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