In Rhinopython I’m trying to add a new key-value pair in the Attribute User Text.
I hoped
rhinoscriptsyntax.SetUserText(object_id, key, value=None, attach_to_geometry=False)
would be able to make a new key if is not yet present, but alas.
How can I do this?
Kind regards,
Dick
Here it seems to work as you expected, Have you tried something like its example?
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select object")
if obj:
rs.SetUserText( obj, "PartNo", "KM40-4960" )
rs.SetUserText( obj, "Price", "1.25" )
Moved to Scripting category
@Mahdiyar, thanks.
Then I’m doing something else wrong.
I should have tried this simple script first, before asking … 