ObjectName

Returns or modifies the user-definable name of an object.

Syntax

rhinoscriptsyntax.ObjectName ( object_id, name=None )

rhinoscript.object.ObjectName ( object_id, name=None )

Parameters

object

Required.  String, Guid, or List of Strings or Guids.  The identifier of the object(s).

name

Optional.  String.  The new object name.  If omitted, the current object name is returned.  Note, if object_id is a list of multiple ids , name is required.

Returns

String

If name is not specified,  the current object name if successful.

String

If name is specified,  the previous object name if successful.

Number

If object_id is a list, then the number of objects modified if successful.

Example

import rhinoscriptsyntax as rs

points = rs.GetPoints(message1="Pick some points")

if points:

    count = 0

    for point in points:

        obj = rs.AddPoint(point)

        if obj:

            rs.ObjectName( obj, "Point"+str(count) )

            count += 1

Also See

ObjectsByName

ObjectNames