sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    Urasik Extensions | Lots of new extensions to check out Learn More

    Move! bug?

    Scheduled Pinned Locked Moved Developers' Forum
    1 Posts 1 Posters 602 Views 1 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.
    • J Offline
      Jim
      last edited by

      Does everyone know this but me... 😳

      First, the API docs for the Group.move! method:

      @unknownuser said:

      move!
      This method is the same as the transform! method except that it does not record the move in an undo operation. This method is useful for transparently moving things during an animation.

      This code tells a different story. It seems that grp2 is moved to an absolute position even if a Vector is used for the Transformation object. My expectation is that both groups would be moved 3 times, leaving a trail of numbers.

      require "sketchup.rb"
      
      puts Time.now
      grp1 = Sketchup.active_model.selection[0]
      grp2 = Sketchup.active_model.selection[1]
      v1 = Geom;;Vector3d.new(X_AXIS)
      v2 = Geom;;Vector3d.new(X_AXIS)
      v1.length = grp1.bounds.width * 2
      v2.length = grp2.bounds.width * 2
      tr1 = Geom;;Transformation.new(v1)
      tr2 = Geom;;Transformation.new(v2)
      3.times do |i|
         grp1.transform! tr1
         grp2.move! tr2
         Sketchup.active_model.entities.add_text "g1-#{i+1}", grp1.transformation.origin
         Sketchup.active_model.entities.add_text "g2-#{i+1}", grp2.transformation.origin
      end
      
      
      

      Hi

      1 Reply Last reply Reply Quote 0

      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 Login
      • 1 / 1
      • First post
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement