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:

  1. Make sure you have the RhinoCommon Project Wizard (Windows or Mac) installed.
  2. Launch Visual Studio and open your plugin project.
  3. 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….
  4. Select the Empty RhinoCommmon Command template from the list of installed templates.
  5. Provide a unique file name that relates to the command you are adding.
  6. In Visual Studio for Windows, click the Add button. In Visual Studio for Mac, click the New button.