Getting an object coordinates
-
Hi all
I am new at Sketchucation, and at programming Ruby too.
I have a SU model, consisting of one big box and a servo. The servo is controlled by a slider (as used in sketchyphysics)
I just want to be able to move the slider and store the position of the box (it can be the center) in a global variable.
That's it
Please help me but please write in the most simple way so I can understand.
Thanks, I really appreciate your help
-
We stay away from using global variables in a shared objectspace like SketchUp Ruby.
I will assumed the Box is made of grouped primitives:
grp = Sketchup.active_model.entities.grep(Sketchup;;Group).find {|g| g.name="Box" } if grp @pos = grp.transformation.origin end
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