algorithmic modeling for Rhino
Hi there.
I am interested in emulating the functionality of the Python/C# IO parameter's functionality:
On "+" or "-" you are able to remove input or output parameters.
My questions are:
1. Is this done through override the Render()?
2. I have an inkling on how this is done -- through generating the RegisterInputParams/RegisterOutputParams dynamically?
EDIT: Oh it looks like ghPython is open sourced. I'll check out its source code then -- thanks! https://github.com/mcneel/ghpython
Tags:
Implement IGH_VariableParameterComponent in your GH_Component class and watch the magic unfold.
See: http://www.grasshopper3d.com/forum/topics/gha-developers-implementi...
--
David Rutten
david@mcneel.com
They are the same. RegisterInputParams is called only once, from within the constructor of the GH_Component class. This is where you have to setup the default parameter layout.
--
David Rutten
david@mcneel.com
You implement the IGH_VariableParameterComponent in your component class:
public MyComponent : GH_Component, IGH_VariableParameterComponent
{
public MyComponent() : base(......){}
// implement CanInsertParameter, CanRemoveParameter etc. here.
}
--
David Rutten
david@mcneel.com
It could be that exceptions are thrown by the new methods that GH silently handles. Can you post a GHA file that shows this behaviour?
--
David Rutten
david@mcneel.com
I can see one bug:
pManager[5].Optional = true;
You only have 5 inputs so the highest valid index is 4, not 5. This method will probably throw an indexoutofrange exception which causes the component to not even load.
If that's indeed the problem, let me know and I'll some more informative messaging.
--
David Rutten
david@mcneel.com
Yup, reflector.
When the discussion gets nested too deep, Ning doesn't allow further responses. It's a stupid limitation but nothing we can do anything about.
--
David Rutten
david@mcneel.com
Since we're already nested so deep, let's start a new discussion about this.
--
David Rutten
david@mcneel.com
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