Hi Marco @mp1
I moved the conversation to a new topic, so it might be useful also to other users.
OK; then it makes sense.
We need to dig a little deeper into the Grasshopper SDK. Here is how:
def RegisterInputParams(self, pManager):
p = Grasshopper.Kernel.Parameters.Param_String()
self.SetUpParam(p, "matName", "matName", "Name of the material.")
p.Access = Grasshopper.Kernel.GH_ParamAccess.item
p.SetPersistentData(Grasshopper.Kernel.Types.GH_String("Test"))
self.Params.Input.Add(p)
p = Grasshopper.Kernel.Parameters.Param_Number()
self.SetUpParam(p, "E", "E", "Young's Modulus [MPa].")
p.Access = Grasshopper.Kernel.GH_ParamAccess.item
p.SetPersistentData(System.Array[float]([42.0]))
self.Params.Input.Add(p)
There’s nothing bad at treating None as a particular value. Python has the feature of null values also for numbers.
I hope this helps,
Thanks,
Giulio
–
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com