algorithmic modeling for Rhino
Dear GHA developers. As you may have noticed the preferred gui for variable parameters has changed in 0.8.0060. The old gui is still available, but has been marked Obsolete and will soon no longer be visible in Visual Studio autocomplete.
If you have a GH_Component class that implements IGH_VarParamComponent and you wish to switch over to the new gui, please do the following:
Methods to implement for IGH_VariableParameterComponent:
I'll try and write a topic for this in the SDK documentation as soon as possible but until then, feel free to ask any questions about this here.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Tags:
this is your problem:
IGH_Param p = (IGH_Param)new Grasshopper.Kernel.Types.GH_Number(0);
p.NickName = GH_ComponentParamServer.InventUniqueNickname("abc", Params.Input);
return p;
You need to return an instance of a class which implements IGH_Param.
GH_Number is a data type, not a parameter.
Param_Number param = new Param_Number();
param.Name = "Input X";
param.NickName = "X";
param.Description = "Do something";
param.AddPersistentData(0.0);
return param;
where Param_Number can be found in the Grasshopper.Kernel.Parameters namespace.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks, really.
I've changed the comments to English and corrected everything in the attached file. Now it works :)
It's a simple adder, that adds the variable inputs into one single output, but I hope it helps anyone who founds himself stuck as I were.
Thanks so much, It helped me.
I am updating some components with the old Variable Parameters system with the new ZUI version. Everything is going ok, except this particular component has no output parameters and I am saying that if the side is output, no parameters should be able to be added:
public bool CanInsertParameter(GH_ParameterSide side, int index)
{
if (side == GH_ParameterSide.Output)
{
return false;
}
if(index == 0)
{
return false;
}
return true;
}
Still, I get a + sign on the output:
Just a little thing, but it's messing with me!
Darn, it's a bug (obviously). When there are no outputs I dont even ask whether it's ok to draw a (+)... It'll be fixed in the next release, nothing you can do about it in the meantime...
--
David Rutten
david@mcneel.com
OK. Happy to help finding bugs! Thanks for the reply.
Luis
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by