I’m trying to figure out the best way to update the registry while developing a plugin after adding new commands. Ideally I’d like to reload the plugin and have it modify the registry settings as it does the first time I load the plugin.
I’ve tried deleting the registry key and then reloading the plugin - but that fails to initialize.
Is the only option for updating the command list to modify the registry manually?
I’m not sure what is going on, but the way it is supposed to work is that you register the plug-in once with Rhino, and the most easy way is to drag it onto a running instance of Rhino. Then, as you have seen in the registry, the plug-in is known to Rhino.
Each time you add or remove a command, you must exit Rhino, then re-build the plug-in in Visual Studio, then start Rhino again. The new command is then available.
Caveat: if your plug-in loads “on-demand” (see PlugIn.LoadTime property), the new commands are only available when the plug-in has been loaded. As the plug-in is loaded on demand, you must first issue a known command. Then the plug-in is loaded by Rhino and the new command list is available.
You can override the PlugIn.LoadTime property to return AtStartUp. Once that is known by Rhino (run a known command!) the plug-in is loaded immediately when you start Rhino.
If you don’t need to do this, I would recommend not changing the loattime to AtStartUp as that slows down the general loading of Rhino.
You should be able to call any of your existing commands which will cause the plug-in to be loaded and have all of the commands properly registered as Menno pointed out.