Forgot password?

Create an account!

Forum

« back

RhinoScript – Object name/id

Messages

Please log in to write a message.

  • 6. thommie84 (Jul 24, 2013 15.27):

    Thanks Johannes for the quick respons!

  • 5. Johannes (Jul 24, 2013 15.22):

    Hi, you can use USERTEXT. With setUserText and getUserText you can write and read additional information of a Rhino object (key/value).

    Rhinoscript functions:
    - Rhino.SetUserText (strObject, strKey [, strValue [, blnAttachToGeometry]])
    - Rhino.GetUserText (strObject [, strKey [, blnAttachToGeometry]])

    Discussions:
    - v5.rhino3d.com/forum/topics/read-write-user-data

    UserData Manager:
    - rhino3d-udm.blogspot.de/


    Johannes

  • 4. thommie84 (Jul 24, 2013 15.05):

    Hi!

    Is it possible to add extra data to an object?

    For example a SubName/number?

    Objectname= frame1
    Partnumber= 0001

    Thanks in advance!

  • 3. drape (Aug 26, 2009 02.52):

    Maybe worth noting that the Object ID of strName in Sel_ObjectName() is arrObjects(0). (ObjectsbyName returns "An array of strings identifying the objects if successful." So...)


    Call Sel_ObjectName()
    Sub Sel_ObjectName()

    Dim arrObjects, strName

    strName = Rhino.GetString("Name to select")

    If Not IsNull(strName) Then
    arrObjects = Rhino.ObjectsByName(strName, True)
    End If

    Msgbox "ObjectID of strName: " & arrObjects(0)


    End Sub

  • 2. Johannes (Aug 13, 2009 15.32):

    Hi,

    you can try the following functions to see the name/id of an object or to select an object by name (2nd sub):

    Call ObjectName()
    Sub ObjectName()
           
            Dim strObject
            Dim ObjectName, ObjectID
           
            strObject       = Rhino.GetObject ("Pick object")
           
            ObjectName      = Rhino.ObjectName (strObject)
            ObjectID        = strObject
           
            Msgbox "ObjectName: " & ObjectName
            Msgbox "ObjectID: " & ObjectID
           
    End Sub

    ' thats a rhino function called "objectsbyname"

    Call Sel_ObjectName()
    Sub Sel_ObjectName()
           
            Dim arrObjects, strName

            strName = Rhino.GetString("Name to select")

            If Not IsNull(strName) Then
                    arrObjects = Rhino.ObjectsByName(strName, True)
            End If

    End Sub

    Johannes

  • 1. NHD (Aug 13, 2009 13.16):

    Hi,
    Somebody who knows how I can find the Rhino id for objects (curve, surface I have defined with a name).

    After the definition of for instance a curve with a given name, Rhino give it a unique id. If i use the name for the curve to copy the curve, Rhino understand/translate the name/id. But if I use a string with the same name (for instance in a For Next loop - "curve" & number) Rhino don't understand the id. The string is just treated as string not as the reference to object defined with that string/name.

Recommend

Why are these buttons gray?