What is RhinoCommon?
This guide gives an overview of RhinoCommon.
RhinoCommon is the cross-platform .NET plugin SDK available for:
- Rhino 5 for Windows (both 32 and 64-bit versions)
- Rhino 5 for Mac
- Rhino.Python scripting
The term common is meant to be just that: an SDK that can be used across Rhino platforms. A plugin built with RhinoCommon could potentially run on both Windows and Mac platforms with no changes…
RhinoCommon is composed of the following pieces. These files are included with Rhino 5 for Windows and Mac:
- RhinoCommon.dll - This is a pure .NET DLL that plugins can reference and use to work with Rhino.
- RhinoCommon.xml - This is an XML file that contains SDK documentation comments specific to RhinoCommon.dll. Programming development environments like Visual Studio and MonoDevelop use this XML file to display tooltips and other helpful information while the developer writes code.
- rhcommon_c.dll and monomanager.rhp - These are C++ shared libraries compiled for specific target platforms (Win32, Win64, and macOS). These libraries are used by RhinoCommon, but should never be directly accessed by plugin developers.
RhinoCommon on macOS is executed through an embedded Mono framework.
Rhino uses RhinoCommon
All .NET plugins that ship with Rhino 5 for Windows and Rhino 5 for Mac, including the Python interpreter, reference RhinoCommon.
In 2011, Grasshopper was rewritten using RhinoCommon. This was a big project and took some time to complete, but once done it provided performance improvements and better memory management. This is also a step toward Grasshopper running on Rhino for Mac.
The Python script engine is entirely based on RhinoCommon. All python scripts use RhinoCommon to work with Rhino. Typically, if it is difficult to write a Python script using a RhinoCommon API, then the RhinoCommon SDK needs to be fixed.
RhinoCommon plug-ins will only load in the same service release or greater of Rhino that the plug-in was built against. For example, if your RhinoCommon plug-in project references RhinoCommon.dll from Rhino 5 SR9, then your plug-in will load in Rhino 5 SR9, SR10, etc. But, it will not load in Rhino 5 SR8. Thus, if you want to support older service releases of Rhino, you will need to revert to an older service release. It is encouraged that you always target the latest service release of Rhino.