How to get the objectname in ghpython?


#1

Hey guys.
I do not know why I can not get the objectname in ghpython.
But I can get it in python script.

Anyone can help? Thanks.


#2

Hi Sheng,

Once you reference something from Rhino to Grasshopper, Geometry information gets passed, but Attributes do not. That is why you can’t retrieve the name of your object, the way you did that in Rhino python Editor.
But you can always get back to Rhino document and retrieve information on object name, colour, layerindex…

Check the attached files.
object_name_ghpython.gh (4.7 KB)
object_name_ghpython.3dm (19.0 KB)


Surface Name
#3

Hi djordje, thank you very much!
It’s really helpful.
Now I know the Rhino.DocObjects class.
Thanks.