Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
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
Advertisement