Multiple node connecting

I’m guessing you are talking about the last input that is automatically added ?

In the component constructor, there is an event handler to add :

public SmartEntwine()
            : base("Smart Entwine", "Smart Entwine", "Flatten and combine a collection of data streams. Cool options available in menu.", "Sets", "Tree")
        {
            this.Params.ParameterSourcesChanged += new GH_ComponentParamServer.ParameterSourcesChangedEventHandler(this.ParamSourcesChanged);
        }

And the associated method that adds an input if necessary - I do my parameter soup here, it could be simpler.

private void ParamSourcesChanged(object sender, GH_ParamServerEventArgs e)
        {
            mysc = 0;
            for (int i = 0; i < this.Params.Input.Count; i++)
            {
                mysc += this.Params.Input[i].SourceCount;
            }

            if (e.ParameterSide == GH_ParameterSide.Input && e.ParameterIndex == this.Params.Input.Count - 1 && mysc > sc)
            {
                IGH_Param iGH_Param = CreateParameter(GH_ParameterSide.Input, this.Params.Input.Count);
                this.Params.RegisterInputParam(iGH_Param);
                this.VariableParameterMaintenance();
                this.Params.OnParametersChanged();

                }

            }


        }

A lot of useful info there :

6 Likes