Grasshopper

algorithmic modeling for Rhino

pManager.Register_StringParam(String, String, String); is obsolete?

Hi Guys,

I get the message `pManager.Register_StringParam(String, String, String); is obsolete and has been replaced by AddTextParameter()` Is there a new approach to registering input/output parameters for custom GH components?

Many thanks,

Arthur

Views: 482

Replies to This Discussion

Thanks Andrew! I must have missed that thread. Another item is obsolete: the `AssemblyName` method but this time I saw this thread. Nevertheless I am not sure how to override the name of the obsolete members... Any examples out there? Cheers.

It works by replacing:

pManager.Register_StringParam(String, String, String);

with

pManager.AddTextParameter(String, String, String);

Still haven't figured out how to fix the Assembly name though, this is as far as I went:

namespace CustomComp
{
    public class CustomComp_Info : GH_AssemblyInfoStub
    {
        public override string AssemblyName
        {
            get
            {
                return "CustomComp";
            }
        }
     
    }
}

Usually when a method or a class has been marked as Obsolete it has been replaced by a different method/class. In the case of Register_StringParam() it was AddTextParameter() (as the compiler warning told you). The other warning should direct you towards the Name property, which has replaced AssemblyName.

Instead of overriding AssemblyName, now override Name instead.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks David, it is working now:

namespace CustomComp
{
    public class CustomComp_Info : GH_AssemblyInfo
    {
        public override string Name
        {
            get
            {
                return "CustomComp";
            }
        }
     
    }
}

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service