Geom::Transformation
-
I am totaly beginner in Sketchup scripting.
This code move object to some position,
trans = Geom::Transformation.new(bb.center.vector_to([100,0,0])) ; # move the temp bounding box
How is posible to move object just by zaxis and other axis dont affect. -
Your example uses a point
[100,0,0]to move the object 100 inches along the X_AXIS.
To move it in the Z_AXIS just try[0,0,100]Also it'll be best to do a simple 'translate' rather than '[re]locate' it ?
trans = Geom::Transformation.translation([0, 0, 100])A three element array can be substituted for a point or a vector.
If you want units other than inches do it like this
100.mm -
I have some object with his location, and select it and i want just to move this object to zaxis=0, and leave other axis unchanged.
-
Slightly different question.
If you want to move its center onto the ground-plane [z=0], consider this...### ... bb = some_object.bounds ct = bb.center pt = ct.clone pt.z = 0 ve = ct.vector_to(pt) tr = Geom::Transformation.translation(ve) some_object.transform!(tr) -
Thanks!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement