sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    How does one get the current model axis?

    Scheduled Pinned Locked Moved Developers' Forum
    11 Posts 3 Posters 537 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.
    • thomthomT Offline
      thomthom
      last edited by

      I need to get the vector for the model axis when the user has defined a custom one. But what methods to use?

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

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        There is no API method for it.

        The work around is to get a bounding box object which is always aligned to the current axis. Then use its points to determine the x,y,z vectors of the current model axis.

        I think that is how it works. I had to do it in my standard views plugin. This only works in 7.0 and up I think, because 6.0 does not align the bounding box to the user defined model axis.

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

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

          Arrg! There goes SU6 support! πŸ‘Š
          Well full support that is, I need it to be able to support Axis lock for my plugins, when you press the arrow keys.

          sigh

          I was hoping I'd just overlooked an API method.

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

          1 Reply Last reply Reply Quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            Axis lock doesn't natively lock to the user defined axis? Seems like it should. I have very little experience with axis locking and inferencing, so I don't really know too much about it.

            Chris

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

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

              hmm.... works for SU7 - thanks.

              But it annoys me that this doesn't work in SU6. Most my plugins work in at least SU6, and the Axis lock is a really nice feature. grumble
              Is there no other hack available?

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

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

                @chris fullmer said:

                Axis lock doesn't natively lock to the user defined axis? Seems like it should. I have very little experience with axis locking and inferencing, so I don't really know too much about it.

                Chris

                No - there is no API to activate the Axis lock. I had to create a second input point in the axis vector and use view.lock_inference.

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

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

                  @dan rathbun said:

                  (b) IF the user moves the "World Origin" with the Axes Tool, would that shift the model geographically, if it (the model,) was then re-uploaded to Goole Earth?

                  I think the model remains un-shifted geographically. I think it is locked to the absolute origin of Sketchup. When you change the model axis all the co-ordinates for the geometry remains the same.
                  But I've not tested this in GE...

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

                  1 Reply Last reply Reply Quote 0
                  • Chris FullmerC Offline
                    Chris Fullmer
                    last edited by

                    I agree with Thom. Models are locked to the SketchUp world axis, not the used defined axis.

                    My interperetation of the answers would be:

                    a- true, just like that.

                    b-The user never actually moves the world origin. They can only move a user defined origin, but the SketchUp original origin is always in the same place in the model. The SketchUp world origin is geolocated using the latitiude and longitude data that can be set in the model, and set through ruby.

                    Lately you've been tan, suspicious for the winter.
                    All my Plugins I've written

                    1 Reply Last reply Reply Quote 0
                    • Dan RathbunD Offline
                      Dan Rathbun
                      last edited by

                      @chris fullmer said:

                      b-The user never actually moves the world origin. They can only move a user defined origin, but the SketchUp original origin is always in the same place in the model.

                      OK.. thanks.
                      That's good in a way that coders can always rely on having an 'OmniOrigin' to reference.

                      So to move the model geographically... either one must 'Select All' and move everything with respect to the OmniOrigin, or tweek the Lat/Long a bit.

                      I'd still like both manual GUI and scripting API of Named UCS objects, as in AutoCAD.

                      I'm not here much anymore.

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

                        @dan rathbun said:

                        I'd still like both manual GUI and scripting API of Named UCS objects, as in AutoCAD.

                        Well, you can set up scenes to only change the axis. Though the co-ordinates remains the same. But one never really deal with them in SU.

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

                        1 Reply Last reply Reply Quote 0
                        • Dan RathbunD Offline
                          Dan Rathbun
                          last edited by

                          Question(s) on Axes:

                          (Background: I am used to how other CAD / Modeling applications had a World Originand a World Axes [ie, WCS], and this allowed the user to create any number of named User Origins [offset from the World Origin, specified with a vector;] meaning the World origin was always remembered, but could itself be moved by the user. AutoCAD used to call these a UCS. I suppose then you could define the Axes for these UCS.)

                          So... in Sketchup, currently:

                          (a) I assume (and this is part of the question; I'd like a confirm,) that the Georeferencing Location for the model is based on the Sketchup model's World Origin.
                          (b) IF the user moves the "World Origin" with the Axes Tool, would that shift the model geographically, if it (the model,) was then re-uploaded to Google Earth?

                          I'm not here much anymore.

                          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