Hi,
I’m looking for a means to set the textstring for a V6 annotation text object.
All I could find is …TextEntity.SetRichText() yet I cannot get that to work.
Is anything already in place to set the string for a TextEntity objects?
Thanks
-Willem
Hi,
I’m looking for a means to set the textstring for a V6 annotation text object.
All I could find is …TextEntity.SetRichText() yet I cannot get that to work.
Is anything already in place to set the string for a TextEntity objects?
Thanks
-Willem
Hi @Willem,
TextEntity.Text seems to work here in V6 to change the text done with _Text command:
import scriptcontext
import rhinoscriptsyntax as rs
def DoSomething():
id = rs.GetObject("Select Text entity", 512, True, False)
if not id: return
te = rs.coercegeometry(id, True)
te.Text = "TestTestTest"
scriptcontext.doc.Objects.Replace(id, te)
scriptcontext.doc.Views.Redraw()
DoSomething()
There is another example here which works without replacing.
c.
Hi Willem,
The next WIP will have a bunch of changes with respect to the annotation classes in RhinoCommon. All of the V6Annotation classes will be gone and all of the new functionality has been merged into the older annotation classes. You should be able to set the text using the Text property like in the past.
Hey @stevebaer - I’m not sure OP is asking this, but it sounds close to what I am looking for. I’m wondering if there is a way to make a text object appear as a TEXT – let’s say it’s the word “Strawberry” on the layout sheet… and when you click it <or something else?> there’s a drop down with pre-programmed(?) other words, like “banana” “blueberries” etc. and you can choose one and then it changes the text object to that choice ?