Hi Giulio, I was looking for a way to add a Default value by GHPY but no lack.
As you can understand, I would like to add a default string value i.e. “S235” or a float. 210000.
What is the correct way?
Can you be kind to show also how to add a default vector? i.e. rg.Vector3d(0,0,0)?
Best,
Marco
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
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
self.Params.Input.Add(p)
Hi @piac.
I didn’t want want to spend time learning C# and I am compiling a project by .ghpy at the moment.
I have realised that maybe in the future c# will be better but I am at the very end of a project.
Is it hard to have a default value that the user can see?
I am applying default value inside the script but I was tempted to have a more elegant way.