Sets or removes user text stored on an object. For more details on User Text, see the discussion found in the User Data Methods summary.
rhinoscriptsyntax.SetUserText (object_id, key, value=None, attach_to_geometry=False)
rhinoscript.userdata.SetUserText (object_id, key, value=None, attach_to_geometry=False)
object_id |
Required. String or Guid. The object's identifier. |
||||||
key |
Required. String. The key name to set. |
||||||
value |
Optional. String. The string value to set. If omitted the key/value pair specified by key will be deleted. |
||||||
attach_to_geometry |
Optional. Boolean. The location on the object to store the User Text.
|
Boolean |
True or False indicating success or failure. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select object")
if obj:
rs.SetUserText( obj, "PartNo", "KM40-4960" )
rs.SetUserText( obj, "Price", "1.25" )