C# Kangaroo custom goal not working?


I am trying to use a grasshopper file containing a custom C# goal by Daniel Piker.

I hadn’t experienced any issues opening the file before; now I need a little bit of help.

First, the C# goal says KPlankton isn’t found:

  1. Error (CS0246): The type or namespace name ‘KPlankton’ could not be found (are you missing a using directive or an assembly reference?) (line 27)

Not sure what this means, I do have Plankton in my library folder

If I open the code and delete line 27, following a similar issue in a different thread, then I get this other warning:

  1. Warning (CS1701): Assuming assembly reference ‘RhinoCommon, Version=5.1.30000.13, Culture=neutral, PublicKeyToken=552281e97c755530’ matches ‘RhinoCommon, Version=6.34.21034.7001, Culture=neutral, PublicKeyToken=552281e97c755530’, you may need to supply runtime policy

Not sure what this means either, yet following another similar thread, I right-click the C# goal and go to “Manage assemblies”, where I click ‘add’ to then specify the current kangaroosolver.dll location.

Warnings go away and the C# goal looks ‘normal’:

Nonetheless, the kangaroo solver does not seem to accept said goal:

I have Rhino 6, 7, and WIP installed, with no .dll or .gha warnings when I open them separately.

My Libraries folder shows the following kangaroo-related .dlls and .ghas:

I believe this is happening with any C# goal going into kangaroo, as I am experiencing this with more than one file.

How can I solve this issue? Is this related to having multiple installs?

Thank you for your feedback

Hi @René_Corella

The important thing is to reference the same copy of the Kangaroo library being loaded by the version of Rhino you are currently running.
For instance, if you are running Rhino 6 and you reference the copy of Kangaroo from the Rhino 7 folder, it won’t work.

I believe the directories are usually:

C:\Program Files\Rhino 6\Plug-ins\Grasshopper\Components

C:\Program Files\Rhino WIP\Plug-ins\Grasshopper\Components
(if you first installed v7 when it was a WIP)

C:\Program Files\Rhino 7\Plug-ins\Grasshopper\Components

C:\Program Files\Rhino 8 WIP\Plug-ins\Grasshopper\Components


Thank you!

This solves the problem, which I created in the first place reinstalling Rhinos to a separate storage drive and kept choosing the .dlls from the ‘libraries’ in Roaming :zipper_mouth_face:

Thank you @DanielPiker

*and forgive me for not reading the ReadMe

Hi, thanks in advance so much for sharing time and knowledge.

I am having the same issue working with Daniel’s Piker grasshopper file for reciprocal structures design using Rhino 6. I get the same error in the custom C# goal:

  1. Error (CS0246): The type or namespace name ‘KPlankton’ could not be found (are you missing a using directive or an assembly reference?) (line 13)

I checked several times the correspondencies between files and folders and everything seems alright but still doesn’t work. :frowning:

Here some captures.

2021-05-16 23_57_28-Libraries

2021-05-16 23_57_11-Libraries

Any idea how to solve this issue?

Thanks very much for the feedback.

Hi @santiago.vera.bianco
Which version of Rhino are you using? and which is the script you are trying to use?

KPlankton is the version of Plankton included inside Kangaroo2 in Rhino7
So you would either need to use Rhino7 and reference the KangarooSolver.dll from the Rhino directory as in the replies above (and in which case there is no need to also reference Plankton.dll), or if sticking in Rhino 6 you would need to modify the script to use the separate Plankton library.

Hi, @DanielPiker, thanks for your time, interest and patience.

I´m using Rhino 6 w/ Kangaroo 2.42, and Plankton 0.69.

The script I’m trying to run is part of a definition that you post last year in a thread discussing Reciprocal structures.

Link to the thread Reciprocal - #23 by Petras_Vestartas

Link to the file ReciprocalK2_2.gh

I would prefer to continue in Rhino 6. In the script, I tried substituting the “Kplankton” by just “Plankton” but didn’t work, it leads to another error. I really don’t know so much about scripting in C#.

As you said, probably the best thing I can do is move to Rhino 7 and reinstall all plugins in order to make the definition works.

Thanks for your suggestions. :pray:

Hola @DanielPiker, thanks again for all.

I finally managed to resolve the issue and make the definition to work under Rhino 6.

  1. Installing all plugins in Plug-ins\Grasshopper\Components folder.

  1. Adding the plugins to the Assembly manager of the custom C# component.

  1. Editing the script lines 13,14 and 60 as shown below.

Hope the solution work to help others as well!