I am currently developing a Plugin for Grasshopper wich uses several C++ SDK’s.
In Visual Studio I have a C++ Project which is dependent on the Rhino 7 SDK and some external dlls and a C# Project which contains all the pinvoke and exposes the functions to Grasshopper Components.
It is working just fine when I copy all the external dll’s in the same folder containing the .gha file and the .dll from my c++ project.
My question is: Is there a way that I can only have the gha and my dll file in the Grasshopper Libraries Folder and add the paths to the external dlls somewhere (as they are all SDKs which come with an installer) ?
I already tried to link them in the GH Priority Load function but that didn’t work.
Thanks in advance!
You could use yak for distribution. This method will let you keep all of your binaries in a single folder.
Thanks for your reply!
I was more thinking of an option to keep the external SDK Files at their position (e.g. C:\Program Files\Some SDK\bin) and add this directory as a reference. Just like I do within the c++ project.
Is there an easy way to do that?
You may be able to adjust the environment path before calling pinvokes.
Is there a reason you would rather not use yak to solve this?
At the moment I’m not planning to make the plugin public etc., because it is part of a research project.
That may change in the future, then yak would be working fine, but for now I would like to keep it local.
You can send people .yak files and have them installed without being on the public package server. @will can provide details
Ah okay, I didn’t know that! Then it would be the solution, thanks!
There are a couple of ways to install a .yak file that isn’t on the public server…
- Follow the “Custom Package Repositories” guide. The people that you want to share the plug-in with will need to configure Rhino to look for packages in a specific folder (in addition to the public server). This folder can either be a shared folder (you add the .yak files) or a local folder on their computer (you send them the .yak files and they copy them into the local folder).
- Send them the .yak file and they can install from the command line, outside of Rhino. For example, assuming the package is called “orange”, they’re on Windows and they drop the .yak file into a folder C:\packages…
"C:\Program Files\Rhino 7\System\yak.exe" install --source C:\packages orange
Seems like we should have drag n drop on Rhino perform an install as well
I will try that, thanks a lot!
Youtrack’d for consideration! https://mcneel.myjetbrains.com/youtrack/issue/RH-66056