Adding Commands to Projects
Problem
The RhinoCommon Project Wizard (Windows or Mac) creates a skeleton plugin project with a single command. However, plugins can contain more than one command. How does one add additional commands to plugin projects?
Solution
To add a new command to your RhinoCommon plugin project, you simply need to define a new class that inherits from Rhino.Commands.Command
.
An easy way to do this is to just use the Empty RhinoCommmon Command template. Here is how you do that:
- Make sure you have the RhinoCommon Project Wizard (Windows or Mac) installed.
- Launch Visual Studio and open your plugin project.
- From Visual Studio, navigate to Project > Add New Item menu item. From Visual Studio for Mac, right-click on the project name in the Solution Explorer and navigate to Add > New File….
- Select the Empty RhinoCommmon Command template from the list of installed templates.
- Provide a unique file name that relates to the command you are adding.
- In Visual Studio for Windows, click the Add button. In Visual Studio for Mac, click the New button.