How to attach Sketchup::Text to Sketchup::ComponentInstance, Again


I want to add text to an instance using Ruby, similar to “Tools/Text”.
The same question was previously asked in the thread below, but I want to know the Ruby command.

I tried using ‘point’ and ‘glued_to’, but they seem to be different. ‘attached_to’ doesn’t work.

text.attached_to = [[ins]), pnt]

This results in #<RuntimeError: Unexpected error.>.

Thank you.

See the API docs. You aren’t setting up the path correctly.


I did it with add_text. thank you!