@bobmcneel suggested that we post this discussion here, on the upcoming Serengeti project forum, as this is material that McNeel employees are actively working on. @stevebaer set up this category for us to start using. @DanielPiker started this discussion. He copied in also @robert_vier and David Stasiuk, as well as @DavidRutten and @piac
_Posted by @DanielPiker _
Hi David, Steve and Giulio,
Dave Stasiuk and I have been working on a new Grasshopper component (an update of our wireframe thickening tool - GitHub - davestasiuk/Exoskeleton2), and coming up against some problems with loading additional libraries.
I’m also including Robert Vierlinger, as I heard he has also encountered some similar issues, and Will Pearson, as we have been working together on the library in question (GitHub - meshmash/Plankton: A C# half-edge mesh data structure, and components for using this in Grasshopper/Rhino).
The Plankton library is split into Plankton.dll, which contains the core, and PlanktonGh.dll which gets renamed as Plankton.gha, and contains the grasshopper specific functions (including a custom parameter type, following Giulio’s example with Turtle) and also some Grasshopper components.
For part of Exoskeleton I wanted to use functions from Plankton, but can’t easily reference the gha in visual studio. Will showed a way of manually editing the .csproj file to get around this, but this doesn’t seem an ideal solution (and it also seems to be more difficult when using the library in Python - see Anders’ comments at the bottom of this page).
If I keep a copy of both PlanktonGh.dll and Plankton.gha (the same file saved with different extensions), then it is possible to reference the dll in other projects, and still have the plankton grasshopper components load, but this only works if COFF loading is switched off. If it is on it gives this strange error:
We want to make the libraries and components easy for others to use, but I fear I am confusing matters, and I would appreciate some guidance on what is best practice here.
I’m guessing the better solution might be to separate the functions we want to re-use in other components into a dll, and have only the actual grasshopper components in the gha, but then I’m not sure what would happen with loading the custom parameter type at grasshopper startup.
Is there a good example to look at for the correct way of organizing this sort of thing?
Thanks,
(signed by @DanielPiker )