ObjectSerialNumber

Returns the unique serial number of an object.

When Rhino constructs a new object, it assigns a unique serial number for that instance.  If the object is copied (i.e. modified in a way that causes Rhino to create a copy of the object to push onto it's Undo stack), then the copy will have a different serial number.  The serial number can be used to identify whether or not an object has changed between two events.

Note, the serial number of an object does NOT persist  in 3DM files and is not unique between instances of Rhino.  Use the object's identifier when you need a persistent and unique way to identify the object.

Syntax

Rhino.ObjectSerialNumber (strObject)

Parameters

strObject

Required.  String.  The identifier of the object.

Returns

Number

The object's runtime serial number if successful.

Null

If not successful, or on error.

Example

Dim strObject

strObject = Rhino.AddCircle(Rhino.WorldXYPlane, 5.0)

' Before move

Call Rhino.Print("Before transformation")

Call Rhino.Print(strObject)

Call Rhino.Print(Rhino.ObjectSerialNumber(strObject))

strObject = Rhino.MoveObject(strobject, Array(0,0,0), Array(5,5,0))

' After move

Call Rhino.Print("After transformation")

Call Rhino.Print(strObject)

Call Rhino.Print(Rhino.ObjectSerialNumber(strObject))

Also See

ObjectDataCRC