generative modeling for Rhino
For custom components is there a way to specify a default value for the Geometry or Generic Parameters, just as in the boolean parameter, i.e.
pManager.Register_BooleanParam("Param", "P", "Example Param", true, GH_ParamAccess.list);
That'd be really handy otherwise, I suppose the only way is to create a custom parameter type. In this case, is there a way to tell grasshopper to treat input from that parameter as a list or tree? I am aware of the DA.Iteration property and accessing the VolatileData field of the parameter, only I was wondering if there was something more "elegant"..
yes, both Generic and Geometry derive from GH_PersistentParam which can store internal data. There are however no overloads for adding this data in the Register_XXXXParameter methods. You'll need to get the parameter afterwards, cast it and assign data yourself. So inside RegisterInputParams, type something like:
Dim param As Param_GenericObject = TryCast(pManager(0), Param_GenericObject)
If (param IsNot Nothing) Then
Brilliant, huge thanks!