SetUserText

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.

Syntax

Rhino.SetUserText (strObject, strKey [, strValue [, blnAttachToGeometry]])

Parameters

strObject

Required.  String.  The object's identifier.

strKey

Required.  String.  The key name to set.

strValue

Optional.  String.  The string value to set. If omitted the key/value pair specified by strKey will be deleted.

blnAttachToGeometry

Optional.  Boolean.  The location on the object to store the User Text.

Value

Description

True

Attaches text information to the object geometry. If the information is closely associated with the geometry, attach it to the geometry. For example, a circle's radius should be attached to the geometry because the information will be invalid if the circle is control-point edited and changed into a NURBS curve.

False (Default)

Attaches text information to the attributes of an object. If the information is higher-level attribute information, like color, then it should be attached to the object's attributes. Attribute information will persist when an object is control point edited, trimmed, copied, and so on.

Returns

Boolean

True or False indicating success or failure.

Null

If not successful, or on error.

Example

Dim strObject

strObject = Rhino.GetObject("Select object")

If VarType(strObject) = vbString Then

  Rhino.SetUserText strObject, "PartNo", "KM40-4960"

  Rhino.SetUserText strObject, "Price", "1.25"

End If

Also See

GetUserText

IsUserText