Document user text

Is there a way to update document user text in rhino five using code. I am using document user text in a title block.

Hi @eric.bunn,

Yes you can. Here is a Python example:

import Rhino
import scriptcontext as sc

key = "test"
value = "Hello Rhino!"

sc.doc.Strings.SetString(key, value)
rc = sc.doc.Strings.GetValue(key)
print rc

new_value = "Hello Eric!"
sc.doc.Strings.SetString(key, new_value)
rc = sc.doc.Strings.GetValue(key)
print rc

You can also do this with C++, C#, or RhinoScript.

– Dale

1 Like

Thanks for the really fast reply. Next time I’m in front of my computer I’ll try this with python. Looks great.