List of output components

Hi, I would like to get the information (in C#) where (in which component) the output from the component is connected (what is the next component after the current one).
It should be similar to the Disconnect from the right click menu where output components are listed. I just need to know their names.

Thank you.

Lukas

You’d iterate over the IGH_Params in the Params.Output of your current component. Then, for each output parameter, you have to iterate over the Recipients list. This will tell you the parameters where the wires end. You may then still have to get the top level object via the parameter attributes if you want to know which component those parameters belong to.

1 Like

Thank you a lot for your help David.

Here is a simple implementation, if someone will needed.
List of output components.gh (8.2 KB)

1 Like

Maybe one more question. How is it possible to iterate over cluster’s output parameter recipients? How to get Params.Output form the cluster where C# component is nested?

Thank you.

This is incomplete example:
List of cluster’s outputs recipients.gh (6.2 KB)

Actualization:
Is it possible to convert IGH_DocumentObject into IGH_Component in the case of Cluster? I guess that the Cluster implements also IGH_Component interface, therefore, this example should be correct right? (at least it is doing what I was expecting :wink: ) Only synchronization can be challenging. I think that I will use only something like an initialization button :slight_smile: for now.

List of cluster’s outputs recipients_2.gh (10.2 KB)

Thank you again.

Yes, a cluster ultimately inherits from GH_Component which implements IGH_Component. So casting to either of those types will work.

if(owner != null)
{
  foreach(IGH_Param param in owner.Params.Output)
    Print(param.NickName);
  A = owner.NickName;
}

Hi @DavidRutten, is there a way to do this in GhPy?
for reference, get B as seen in this?

Actually I think I’m on the right path:

2 Likes