GetUserText

Returns User Text that is stored on an object. For more details on User Text, see the discussion found in the User Data Methods summary.

Syntax

Rhino.GetUserText (strObject [, strKey [, blnAttachToGeometry]])

Parameters

strObject

Required.  String.  The object's identifier.

strKey

Optional.  String.  The key name.  If omitted or an empty string ("") is specified, all key names for the object are returned.

blnAttachToGeometry

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

Value

Description

True

Retrieve text information from 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)

Retrieve text information from 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

String

If strKey is specified, then the associated value if successful.

Array

If strKey is not specified, then an array of key names if successful.

Null

If not successful, or on error.

Example

Dim strObject

strObject = Rhino.GetObject("Select object")

If VarType(strObject) = vbString Then

  Rhino.Print Rhino.GetUserText(strObject, "PartNo")

  Rhino.Print Rhino.GetUserText(strObject, "Price")

End If

Also See

IsUserText

SetUserText