How to create such special Grasshopper component?

Hello everyone!

What’s the way to creat a Grasshopper components that can be added at input, added at output, optional at input and optional at battery?

Thank you in advance for your answer!

You must implement the IGH_VariableParameterComponent interface to get addable/removable inputs and outputs.

To add items into the menu of components, override the AppendAdditionalComponentMenu method. Or something much like it, I don’t remember exactly what it’s called.

Hey,

Here is a sample template were I show you how to implement in a basic level IGH_VariableParameterComponent interface as well as how to override the AppendAdditionalComponentMenu method.

I simplified it from a version I had written, unfortunately I did not compile this new version to see if it is error free, but I am sure it works (:

You can find the documentation of the IGH_VariableParameterComponent interface here

https://developer.rhino3d.com/wip/api/grasshopper/html/T_Grasshopper_Kernel_IGH_VarParamComponent.htm

MyFirstZUIComponent.cs (6.2 KB)

1 Like

Thank you for your reply! Let me know where to start.

Just make a gh component in visual studio:

  1. Open a new visual studio project with the Grasshopper add on for rhino 6
  2. copy paste all the code from within the namespace { } , inside the file that comes by default with the template
  3. Compile the code
  4. Test new component in grasshopper

If you have never done this before check here:

1 Like