sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Model.active_path uses global coordinates?

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 153 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.
    • daikuD Offline
      daiku
      last edited by

      I want to manipulate the component definition for the component the user is currently editing (which is nested 2 layers deep). If I do this:

      ci = model.active_path.last 
      cd = ci.definition
      

      I get a valid component definition of the type I am expecting, but if I examine the geometry in the cd, all of the locations returned are in the global coordinate system - I expected them to be in the local system: relative to the origin of the component I'm editing. This is strange. Can anyone explain what's going on here?

      Clark Bremer
      http://www.northernlightstimberframing.com

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        I think that as a component/group is opened for editing, all co-ordinates are made global.

        Su7.0 introduced a method to help on this matter: http://code.google.com/apis/sketchup/docs/ourdoc/model.html#edit_transform

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • C Offline
          cjthompson
          last edited by

          the way I solve this problem is with entities.transform_entities(entities.to_a,model.edit_transform.inverse), which effectively reset the definition.

          Then, when you are done editing, just do the same thing without the .inverse

          1 Reply Last reply Reply Quote 0
          • daikuD Offline
            daiku
            last edited by

            @thomthom said:

            I think that as a component/group is opened for editing, all co-ordinates are made global.

            That explains much.

            @thomthom said:

            Su7.0 introduced a method to help on this matter: http://code.google.com/apis/sketchup/docs/ourdoc/model.html#edit_transform

            And I'll have to transform them all back myself, I guess. Thanks, Thomas.

            Clark Bremer
            http://www.northernlightstimberframing.com

            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