Rhino python GUID

Hi everyone,

I am scratching my head with what I think is Rhino Python 101, but I can’t figure it out.

As output of Rhino Python (rhinoscriptsyntax) commands, I get two kinds of information to represent objects:

  1. c7298776-815f-4933-b3b1-7358af5a1a6f
  2. <System.Guid object at 0x0000000000000048 [007f8863-4e8e-4bd9-9974-0f6cbc4390f2]>

The first one is what I understand to be the GUID. Could you please confirm?
Then, how do you call the second one?

By the way, please let me know if the topic is already answered somewhere, but as I don’t know the name of the second data structure, it is very hard to make an accurate search…
I promise you I searched! :pensive:

Finally, is there a command to switch from one data structure to the other?
My problem is:

  • I have a list of “type 2” objects: [<System.Guid object at 0x0000000000000048 [007f8863-4e8e-4bd9-9974-0f6cbc4390f2]>, <System.Guid object at 0x0000000000000049 [4ac13a7d-3aa1-4390-96c9-208b776b5150]>, …]
  • I loop on the elements of the list, I get a “type 1” object: 007f8863-4e8e-4bd9-9974-0f6cbc4390f2, …
  • I need to use these IDs in the frame of a rs.Command for the usage of the -_MeshSplit command (which does not have a python command) with _SelID
    rs.Command("-_MeshSplit _SelID {} _Enter _SelID {} _Enter".format(to_split, cutting))

What should be the type of the input for _SelID?

Context: I am trying to handle all the possible scenario for to_split and cutting:

  • “type 1”/"type 2
  • single element / list of elements

Any help is welcome,

Best regards,
Nathan

The first GUID is a GUID in string form. The second one is a GUID represented by the type System.Guid.

import System

guid_as_string = "c7298776-815f-4933-b3b1-7358af5a1a6f"
guid = System.Guid(guid_as_string)
print(guid)
print(guid_as_string == guid.ToString())

_SelID takes the string

1 Like

Hi @nathanletwory

Brilliant, thanks, I think it should solve all my problems!

EDIT: my last comments were completely wrong, removed them.

Best regards,
Nathan