algorithmic modeling for Rhino
It is. You can iterate over all the objects in the GH_Document. That will tell you which top-level objects are present. It will not include input and output parameters of components. If you want to include those as well, then you'll need to iterate over all attributes in the GH_Document.
Relationships are a bit harder to get. You could either iterate over all the attributes, find all parameters and look at the Sources and Recipients lists. You could also use the GH_Document.CreateConnectivityDiagram method to create a data structure which contains all the forwards and backwards links that are present in a GH_Document.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
thank you...
How can get GH_Document instance of active document?
The Script component will have a GrasshopperDocument field you can use. Or you can use Component.OnPingDocument() (or owner.OnPingDocument() if you're running an older version of GH)
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by