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
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.
Advertisement