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!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Geom::Transformation

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 2 Posters 1.5k 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.
    • anteolicA Offline
      anteolic
      last edited by

      I am totaly beginner in Sketchup scripting.

      This code move object to some position,

      trans = Geom::Transformation.new(bb.center.vector_to([100,0,0])) ; # move the temp bounding box
      How is posible to move object just by zaxis and other axis dont affect.

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Your example uses a point [100,0,0] to move the object 100 inches along the X_AXIS.
        To move it in the Z_AXIS just try [0,0,100]

        Also it'll be best to do a simple 'translate' rather than '[re]locate' it ?
        trans = Geom::Transformation.translation([0, 0, 100])

        A three element array can be substituted for a point or a vector.

        If you want units other than inches do it like this 100.mm

        TIG

        1 Reply Last reply Reply Quote 0
        • anteolicA Offline
          anteolic
          last edited by

          I have some object with his location, and select it and i want just to move this object to zaxis=0, and leave other axis unchanged.

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            Slightly different question.
            If you want to move its center onto the ground-plane [z=0], consider this...

            ### ... bb = some_object.bounds ct = bb.center pt = ct.clone pt.z = 0 ve = ct.vector_to(pt) tr = Geom::Transformation.translation(ve) some_object.transform!(tr)

            TIG

            1 Reply Last reply Reply Quote 0
            • anteolicA Offline
              anteolic
              last edited by

              Thanks!

              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