When I run the GrasshopperDeveloperSettings command, I can manually add plugin folder paths so Grasshopper can load custom components from those directories.
I’m wondering if there’s a way to add a folder path programmatically, either by using a batch script or a Python command, so I don’t have to add it manually every time.
It depends who it’s for, and how your users will install your plug-in. I use .ghuser launcher components that put my package’s path in sys.path, import it, then restore sys.path.
If you’re using CPython3, publishing to PyPi is an elegant solution. I’ve not tested it, but if the #r: syntax lets you point to a url dependency specifier, then you don’t even need PyPi.
But just to be clear.
When using the command dialog - you shouldn’t have to do it everytime. You only need to do it once.
Beware that any changes made using the command dialog are persisted only if you exit Rhino properly. Killing the rhino.exe task via Task Manager or from Visual Studio by stopping the debugger will make it fail to save your changes.