I am currently attempting to get the id of every component connected to a specific one. I currently have this, but the results don’t add up:
This component’s guid: GH_Component a; a.instanceGuid
The Guids of components connected to a’s outputs:
foreach (IGH_Param inputGhParam in a.Params.Output) {
foreach (var dest in outputGhParam.Recipients) {
System.WriteLine(dest.InstanceGuid); //<- this gives me odd results
//It returns GUIDs but none match any of the others a.instanceGuid
}
}
from ghpythonlib.componentbase import executingcomponent as component
import rhinoscriptsyntax as rs
class MyComponent(component):
def RunScript(self, O):
return self.get_name()
def get_name(self):
names = []
for obj in self.Params.Input[0].Sources:
name = obj.NickName # or obj.Name
names.append(name)
return names