ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
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