How to get the insertion point of a component?
-
how to get the insertion point of a component in the active model? That means the position of the component.
ss = Sketchup.active_model.selection for e in ss if (e.kind_of?(Sketchup;;ComponentInstance) ) point = e.definition.insertion_point puts point end endit shoud bevery simple but I don't get it: I get 0,0,0 with this code but the component is not on 0,0,0...
What's could be wrong?
Thanks !!!!! -
Of course the insertion point of a component definition is always 0,0,0 !
You have to use this instead:ss = Sketchup.active_model.selection for e in ss if (e.kind_of?(Sketchup;;ComponentInstance) ) point = e.transformation.origin puts point end endHope this helps,
-
Yes, It does help!
Merci Didier. -
Yes, I remember now figuring this out when I wrote the 3D Text Tool.
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