If you have not got Rhino Visual Studio working, see this post to get it done.
1. In Visual Studio, create a new project, in the opened dialog, type “rhino” in the upper right filter field:
2. Click Ok in the dialog, and a boiler plate Rhino addin project is created for you.
Click Finish button. Visual Studio opens the project and you can add your code then.
In the Solution Explorer, you can find two C# classes are created for you, and the necessary reference “RhinoCommon” is also added to you. Lovely,
Note that in development for Rhino 4, you generally need a minimum of 3 classes to get a Rhino run, which includes (plugin, command and plugin attribute), the latest RhinoCommon based Rhino development, simplified this and makes more senses and neat.
3. Let’s say hello to Rhino!
Open hello.cs, and browse to RunCommand() function, added below sentence, compile and run!
4. Now Rhino 5 starts. But you may find no changes, and Rhino just runs without appreciating your effort, where is your plugin?
Well, be patient. You have shaked hands with Rhino, but keep talking with her:
- Go to menu Tools > Options
- In the left tree view, click “Plug in”, and then in the right panel, click “Install” button
- Browser your addin dll which is in the bin\debug folder under your project root folder now, and click “open” button to load your dll into Rhino
Now in the command window, type “Hello” and press enter:
Oh, yeah! You have said hello to Rhino now!