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

rhinoscriptsyntax.GetUserText (object_id, key=None, attached_to_geometry=False)

rhinoscript.userdata.GetUserText (object_id, key=None, attached_to_geometry=False)

Parameters

object_id

Required.  String or Guid.  The object's identifier.

key

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

attached_to_geometry

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 key is specified, then the associated value if successful.

List

If key is not specified, then a list of key names if successful.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select object")

if obj:

    print rs.GetUserText(obj, "PartNo")

    print rs.GetUserText(obj, "Price")

Also See

IsUserText

SetUserText