algorithmic modeling for Rhino
Hi all,
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"..
Many thanks.
Yannis
Tags:
Hi Yannis,
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
param.AddPersistentData(blech)
End If
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi..can you share the coding? ..am needing it for my college work..
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by