Site Tools


Creating a Skin using the RhinoCommon SDK

Developer: RhinoCommon
Summary: The Rhino Application Platform (RAP) provides the tools for .NET developers to wrap their application around Rhino 5 by creating custom Skin.

Overview

Rhino 5 allows developers to customize most of Rhino's interface so that the application appears to be their own. We call this a custom Skin. With a custom Skin, you can change the application icon, splash screen, the application name etc.

Creating a custom Skin for Rhino 5 involves creating a custom skin assembly:

  • <skin name>.rhs This is a regular .Net Assemmbly (.DLL) that implements the skin's icon, splash screen, application name, etc. In this article, we will refer this to the Skin DLL. See a full list of methods and properties on the Skin class documentation page.

Create the Skin DLL (.rhs)

  1. To create the Skin DLL, launch Visual Studio 2010 and add a new Class Library project to your solution.
  2. In the new Class Library project, add a reference to RhinoCommon.DLL, which is found in Rhino's SYSTEM folder. Note, make sure, after adding the reference, to set the properties of the reference to Copy Local = False.
  3. Create a new class that inherits from Rhino.Runtime.Skin.
  4. Add a post build event to the project to rename the assembly from .DLL to .RHS:
(TargetPath)" "$(TargetDir)$(ProjectName).rhs" Erase "$(TargetPath)"

Skin Class

C#

namespace MySkin
{
  public class MyHippoSkin : Rhino.Runtime.Skin
  {
    protected override string ApplicationName
    {
      get
      {
        return "Hippopotamus";
      }
    }
  }
  // You can override more methods and properties here
}

VB.Net

Namespace MySkin
    Public Class MyHippoSkin
        Inherits Rhino.Runtime.Skin
        Protected Overrides ReadOnly Property ApplicationName() As String
            Get
                Return "Hippopotamus"
            End Get
        End Property
    End Class
    ' You can override more methods and properties here
End Namespace

Finishing Up

  • Build the Skin project.

Installation

Warning: modifying the registry wrongly can have negative consequences on your system's stability and even damage the system.

To install your custom Skin, use REGEDIT.EXE to add a scheme key to your registry with a path to your Skin DLL. For example:

Rhino 5 64-bit

ItemValue
SubkeyHKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\5.0x64\Scheme: MySkin
Entry nameSkinDLLPath
TypeREG_SZ
Data valueC:\Src\MySkin\Bin\Release\MySkin.rhs

You can now test your custom Skin by creating shortcut to your Rhino executable with /scheme=“<scheme name from the previous step>” as command line argument. For example:

"C:\Program Files\Rhinoceros 5 (64-bit)\System\Rhino.exe" /scheme=MySkin

Rhino 5 32-bit

ItemValue
SubkeyHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\McNeel\Rhinoceros\5.0\Scheme: MySkin
Entry nameSkinDLLPath
TypeREG_SZ
Data valueC:\Src\MySkin\Bin\Release\MySkin.rhs

You can now test your custom Skin by creating shortcut to your Rhino executable with /scheme=“<scheme name from the previous step>” as command line argument. For example:

"C:\Program Files (x86)\Rhinoceros 5\System\Rhino4.exe" /scheme=MySkin
developer/rhinocommon/skin.txt · Last modified: 2014/06/26 (external edit)