Difference between "Registering" parameters and "Adding" parameters?

Hi all

I am working on some custom Grasshopper components using C#. This might be a very straightforward question, however it might be relevant for something I am working on.

When registering parameters (input/output) the manager class has some options to choose from. I was confused when I noticed the following options (in this case for registering output parameters):

protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
    // Method A
    pManager.AddCurveParameter("A", "A", "A", GH_ParamAccess.item);
    // Method B
    pManager.Register_CurveParam("B", "B", "B", GH_ParamAccess.item);
}

Question:

Would someone be able to clarify the difference (if there is one) between registering a curve parameter using Method A (using .AddCurveParameter()) vs. Method B (using .Register_CurveParam()) , and what would be the proper use case (even if there is no difference)?

My initial guess was that by registering (Method B), that no output might be expected (for example for visualization purposes). However, as stated, this is just a guess…

Thanks!

Daan

There is no difference. Register_CurveParam has been marked as Obsolete. I didn’t like the underscore, the abbreviation and the unclear “register” in the old function name, so I ditched it in favour of what I think is a more clearly named method. It’s still there because removing it would have broken plugins which were using the method.

These are the attributes on the Register_CurveParam method:

[Obsolete("This method has been replaced with AddCurveParameter()"), EditorBrowsable(EditorBrowsableState.Never)]

1 Like

Thank you David!