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!
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Moving Axis / Origin of a Group

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 76 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.
    • M Offline
      Minne Danhieux
      last edited by

      Problem: I have lots of groups. I Want to select them. Execute a ruby plug and the Axis/Origing of everygroup is moved to a random location.

      I tried setting transformation.axes but this only tranforms everything inside the group leaving the Axis / Origing to its original position. I found many Similar question and problems but its realy misty on how to do this correct,clean and fast!

      Thx in advance guys. πŸ˜„

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

        You make a transformation
        tr=Geom::Transformation.translation(vector)
        and apply it to the group as:
        group.transform!(tr)
        to move it by that vector.

        You can generate a random vector ...

        If you want to - to move the contents of the group back, so that although it appears to be unchanged its axes are now elsewhere use:
        group.entities.transform_entities(tr.inverse, group.entities.to_a)

        TIG

        1 Reply Last reply Reply Quote 0
        • M Offline
          Minne Danhieux
          last edited by

          Tig, ok this did the trick! THX! πŸ˜„

          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