• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Move! bug?

Scheduled Pinned Locked Moved Developers' Forum
1 Posts 1 Posters 555 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 26 Dec 2007, 22:50

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

    Advertisement