Get objects from a grasshopper component?

Hi @siemen, by importing Grasshopper namespace into python, you can access this. I’ll asume you know how to find document and components already. Once you have the GH component object, you might access the persistent data of it.

e.g. if you have a Brep component which has some breps assigned by the user, you can get Rhino object ids like this:

if component_obj.PersistentDataCount > 0:
    for data in component_obj.PersistentData: 
        if hasattr(data, "ReferenceID"):
            print "ObjectID:", data.ReferenceID

_
c.

1 Like