How does one get the current model axis?
-
I need to get the vector for the model axis when the user has defined a custom one. But what methods to use?
-
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
-
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.
-
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
-
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? -
@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
. -
@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... -
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.
-
@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.
-
@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.
-
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?
Advertisement