External Access

Although the RhinoScript Automation object resides in a Rhino plug-in, external access to this object is available outside of Rhino.  External access to the RhinoScript object is available through Rhino's application object.  Thus, it is possible to access all of the methods provided by the RhinoScript object from other automation aware products and development environments, such as Microsoft Visual Basic.

Rhino Objects

There are several different Rhino object that you can create:




Rhino 4 and 5, 32-bit only.


Rhino 4 and 5, 32-bit only.


Rhino 5, 32-bit only.


Rhino 5, 32-bit only.


Rhino 5, 64-bit only.


Rhino 5, 64-bit only.

Application verses Interface Objects

Creating a Rhino Application object will always result in a new running instance of Rhino.

When you create a Rhino Interface object, if an instance of Rhino is already running, you will be given a reference to this existing Interface object. If Rhino is not running, it will be launched and you be given a reference to this newly created object. Note, if more than one instance of Rhino is already running, there is no way to determine in advance which running instance to which you will be given reference.

What To Use?

If you are planning on writing an application that will automate Rhino 4.0, you will have to decide which automation object to use.

Connecting to Rhino

To create a reference to Rhino's Application object using Visual Basic, use the CreateObject function.  For example:

' Create Application object

Dim objRhino as Object

On Error Resume Next

objRhino = CreateObject("Rhino4.Application")

If (Err.Number <> 0) Then

  MsgBox("Failed to create Rhino4 object")

  Exit Sub

End If

If you wanted to reference an instance of Rhino that was already running, then you could create an Interface object.

' Create Interface object

Dim objRhino as Object

On Error Resume Next

objRhino = CreateObject("Rhino4.Interface")

If (Err.Number <> 0) Then

  MsgBox("Failed to create Rhino4 object")

  Exit Sub

End If

Showing Rhino

There are very few properties methods on the Rhino objects, as it is expected the Rhino plug-ins will provided additional objects with properties and methods. One useful property is the Visible property, which allows you to control Rhino's visibility. For example:

' Shows the Rhino window

Private Sub ShowButton_Click()

  Rhino.Visible = True

End Sub

' Hides the Rhino window

Private Sub HideButton_Click()

  Rhino.Visible = False

End Sub

Connecting to RhinoScript

The RhinoScript object resides in a Rhino plug-in (DLL). Having the RhinoScript object reside in a plug-in allows us to fix bug and add additional features between Rhino releases.

But, this flexibility can also cause some problems when trying to get this object from an automation-aware application. As is often the case, by the time your application has created the Automation (or Interface) object and is ready to ask that object for RhinoScript, Rhino has not had sufficient time to load the RhinoScript plug-in. Thus, you get a runtime error.

The solution to this problem is to make your application to wait, after creating the Application (or Interface) object, before attempting to get RhinoScript. This delay can be performed by using the Win32 API Sleep function. For example:

' Make attempts to get RhinoScript, sleep between each attempt.

Dim objRhinoScript As Object

Dim nCount as Integer

nCount = 0

Do While (nCount < 10)

  On Error Resume Next

  objRhinoScript = objRhino.GetScriptObject()

  If Err.Number <> 0 Then



    nCount = nCount + 1


    Exit Do

  End If


' Display an error if needed.

If (objRhinoScript Is Nothing) Then

  MsgBox("Failed to get RhinoScript")

End If


Rhino Schemes are different sets of Rhino Options that are stored in the Windows Registry. Everything in the Options section of Rhino can be stored in a scheme. In this way, Rhino can be started with different combinations of workspaces, languages, colors, etc. depending on the need or the user, just by starting Rhino from the appropriate desktop shortcut. The schemes exist independently of each other, and can be modified as desired.

If Rhino is launched via ActiveX automation, there is no way to specify an alternate scheme (being that you cannot pass command line arguments when creating COM objects). But, we have provided a hidden registry key that you can use to specify an alternate scheme. Note, this registry key only works if Rhino is launched via ActiveX automation. The registry key is:

HKEY_CURRENT_USER\Software\McNeel\Rhinoceros\4.0\Global Options\Automation

Name: Scheme

Type: REG_SZ

Value: <scheme_name>