Hiiiiiii if I have some text that was created through the text fields, is there a way to then convert it to regular text so if wanted to do a find/replace it doesn’t turn everything to ##### because I’m now losing the link?
If you Explode it, the annotation object will be replaced with curves and text.
I just tested it with a Leader displaying the area of a rectangle.
Hello - this should work - seems not to like dimensions but text and leaders OK so far
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
def ToPlainText():
#id = rs.SelectedObjects()[0]
ids = rs.GetObjects(filter = 512, preselect = True)
if ids:
for id in ids:
geo = rs.coercegeometry(id)
x = geo.Text
if x:
geo.TextFormula = x
sc.doc.Objects.Replace(id, geo)
sc.doc.Views.Redraw()
if __name__ == '__main__': ToPlainText()
-Pascal
Hi John,
this does seem to be the case for me. Explode only affects plain dimensions this way (converting from dynamic <>
dimension field to a number. Any other text field like %<Area("...")>%
remains in its form after exploding, regardles if it is a dimension or a leader.
What am I doing wrong?
As for now, I am only aware of a cringy workaround this by exporting the objects to dwg and re-inserting back to the rhino model. Would be great if there was a simple command like ConvertTextFieldsToPlainText
…
Yes this is how I’ve been doing it too, export as dxf then open copy paste into file
Thanks Pascal, I’ll give this a shot