When I create a new command in a plugin it is not recognized.
It is only recognized when I completely reload the plugin.
Is the reason for this, that obviously on my machine the default setting in Visual Studio is “Do not copy”?
If yes, how can I change this setting… and is then “Copy if newer” the best option?
When your plug-in loads, Rhino “remembers” the plug-in command. In doing this, Rhino can load your plug-in “on demand” when you run one of the commands.
Rhino cannot remember new commands until the plug-in is loaded.
@dale, thanks for the rapid reply.
Just that I understand 100%:
I always thought that a plugin is loaded when I compile it new.
But this is obviously then not the case, right?
A command will notice it changes when “registered” in Rhino and then it’s changed in the code and complied again.
A plugin has to be loaded completely new when a new command is written.
@tobias.stoltmann if you want your new commands to register when Rhino starts, without having to use an existing command to to trigger it, you can change your plugin load time to AtStartup
public override PlugInLoadTime LoadTime
{
get { return PlugInLoadTime.AtStartup; }
}
Although I write it as public override PlugInLoadTime LoadTime => PlugInLoadTime.AtStartup;
I don’t think setting load time to AtStartup is best practice as it does increase Rhino’s load time – if your plugin is not always needed by users, or not needed immediately, it’s best to leave it to WhenNeeded and get into the habit of using an existing command to trigger load. I was definitely confused when I first started developing a plugin that the commands weren’t showing up, so if this is a development convenience thing you could setup a command that runs on startup when debugging through Visual Studio that will trigger your plugin to load.