ZUI + EventHandler

Hi Guys,

I implemented ZUI in one of my components, I want to know if there is a a method with an EventHandler in the Grasshopper SDK that fires up once a new input is created. I want to have a counter that names every new input as such, for example Data 1, Data 2… ect, similar on how the Merge Component does the naming of its inputs.

Here is the scenario I am looking for:

  GrasshopperEventHandlderZUI( ZuiCreated) // ----> just my example

int counter = 0;

  private void ZuiCreated(object sender, EventArgs e)

    public IGH_Param CreateParameter(GH_ParameterSide side, int index)
            Param_GenericObject param = null;

                if (Params.Input.Count > 6)
                    param = new Param_GenericObject();

                    param.Name = "Data" + " " + counter.ToString();
                    param.NickName = param.Name;
                    param.Description = "A Data input";
                    param.Optional = true;

            return param;

Any hints would be great!

wouldn’t you just use this?

Either that, or put all the fixing code in VariableParameterMaintenance(). It is called slightly more often and allows you to make sure all names, nicknames and other properties of inputs and outputs are correct.