Hi,
I would like to reproduce the text tool with the Ruby API
I am able to select a face, to get its center, to generate a text with an arrow pointing this center point but when I move the text the point moves too. I would like the point to stay connected to the center of my face (like using the native sketchup text tool)
I do not want to group the text and the face, I would like the same behaviour than the original tool
Any idea?
model=Sketchup.active_model
ents=model.active_entities
sel=model.selection
vec=[10,10,10]
sel.each{|el|
if el.is_a? Sketchup;;Face
bbox = el.bounds
point = bbox.center
tt = "Her I am"
txt=ents.add_text(tt,point,vec)
end
}