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 )
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