Anchor the leader for text entity
-
When working with the Text tool you can anchor the created leader to Endpoint or Face of the component. Then when you move the component the leader follows the original point on component (or face, etc.).
Is there a way to add a text with the leader by
add_text (Sketchup;;Entities)
function, with leader being anchored to specific Endpoint in my component?
Thanks in advance.
-
So far I have found these links, both of which indirectly confirm that this is impossible with the current API. Can anybody confirm/deny this?
-
I seem to have been involved in these earlier debates - although I don't recall it ! It was some 'years' ago...
Currently it seems impossible to link text/leader with an entity using the API commands directly...
My idea was that once we've made the text we know the thing its related to - let's assume here it's a face - so we can then link the text and face together by giving the face an attribute set that tells us the text's id and initial location... So far so good... now we add an observer to the face which spots if it's changed and finds the text from its id and transforms the text's location to match; it'd also change the attribute value to have the text's new location for a matching transformation next time...
That's the only way I can see to do it...
-
Thank you for your quick reply.
And yeah I noticed your suggestion in one of the above links too.
The observer solution seems a little kludgey to me, especially when you can create the needed leader manually with the Text tool.
So I'm still pretty new to SketchUp development, how that observers solution would work when say I would like to move my *.skp file to the other PC? I would obviously have to move it with the script which sets up observers?
Advertisement