Using other plugins in a plugin


I am currently trying to write a component with c# and I need to use external plugins like Kangaroo, Parakeet and Heteroptera. I would like to ask, can and how do I use them in C#.

Thanks in advance.

1 Like

For Kangaroo you can reference the KangarooSolver.dll and then use the methods to create goals, run solver steps etc. There are some examples of this here:

1 Like

Thanks for quick reply.

So, a dll can be used for kangaroo.Then I assume I will need to have dlls for using other ones, too?
Additionally, can I use default components of grasshopper from C# without any additional dlls?

Sorry for trivial questions but I could not find a documentation that I can read from about these.

Technically you can reference any unprotected library (dll/gha), and you can call any member directly (if public) or indirectly over Reflection. You’ll just need to find out how, which is different for any library involved. Without decompilation this is almost impossible in case there is no documentation.

Furthermore it is likely that you are not allowed to ship them with your plug-in. So you need to make sure that the user always installs the right dependency. This can be very tricky. So the best is just the become independent from as many libraries as possible, ideally you reimplement the wheel.

  1. Check if the licenses of these plugins allow you to use them in your software.
  2. Ask the authors for permission.
  3. A .gha is a .dll with the extension changed, so you can reference them if these are .NET libraries. If Visual Studio doesn’t allow you to do that, just change the extension to reference them as .dll.
  4. Your users will need to have these libraries with your plugin as well.
  5. You can use NodeInCode to use components from code. But keep in mind that this is like doing G(F(x)) when you only need G(x). NodeInCode computes an entire solution in a virtual document just to run a single component.
1 Like

Thanks for the replies. I cannot choose multiple solutions but every reply in this thread is helpful in one way or another.