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

    Global coordinates Question

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 326 Views 3 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.
    • B Offline
      Brett McAllister
      last edited by

      Hi Guys
      Quick question,
      I am creating a tool which uses the pick helper class.
      When I use the picked face method to find the surrounding vertices within a closed group or component , the positions are returned as local coordinates.
      Is there a method within the API to change the values from local to global.
      I tried some of the transform methods but it's all rather vague and I am not having any luck, if anyone has any suggestions it would be greatly appreciated.

      Cheers

      Brett

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

        Something like...

        entities.transform_entities(group.transformation, array_of_points_or_vertices)
        

        untested...
        Where entities is the model.entities [or 'active_entities'?], group is the parent of the point/vertex and the 'array' is the list of things to 'transform'...
        'Nested' groups etc need a transformation for each context...

        TIG

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          The final transformation is the combination of all the parent transformations. So if you have a Group3 nested as follows:

          + Model
            |
            + Group1
              |
              + Group2
                |
                + Group3
          

          Then the Transformation for entities in Group3 is:
          final_trans = Group1.transformation * Group2.transformation * Group3.transformation

          Hi

          1 Reply Last reply Reply Quote 0
          • B Offline
            Brett McAllister
            last edited by

            Thanks for the help,have got it sorted.
            Jim - I really appreciate you sharing the info about the nested components/groups saved a lot of time and effort

            Thanks

            Brett

            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