Print Objs’ Layername.gh
I am trying let Ghpython print out all the selected objects’ layername. I can do it in rhinopython but cannot do the same thing in GhPython, does anyone know why? Did it miss something very basic?
Print Objs’ Layername.py
If you load the objects into grasshopper, they become part of the grasshopper document, and will not have the attributes attached to it. Basically it’s the same as doing a rs.coercerhinoobject() in Rhino Python.
Also read the error message: if you want to do something with the doc objects, you need to set the context to the Rhino doc.
Thanks Gijs, in this case, how can I make it compatible with the GhPython script?
it’s not clear to me what you want to do, if you load your objects into gh, they will not be on a layer
Here the Python objs input is set to Guid.
Print Objs’ Layername_V2.gh (5.3 KB)
Thanks Anders and Adam, this is what I am after~