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!
🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
Getting ComponentInstance position
-
Hey
How can I get the position of some ComponentInstance (which appear in the model) by the ruby?
thank a lot
-
Look up transformation in API...
http://download.sketchup.com/sketchuphelp/gsu6_ruby/Docs/Ruby-ComponentInstance.html#transformation
-
I did read tha API transformation, but still cant get how exactly can I get the position
Assume I want to draw an edge from the (o,o,o) Point to the component position, what should I type in the ruby?
thank a lot
-
Something like this...
comp_instance = (Sketchup.active_model.entities.select{ |e| e.typename == "ComponentInstance"}).first Sketchup.active_model.entities.add_edges( ORIGIN, comp_instance.transformation.origin )
Advertisement