Tell running Rhino application to execute script

I wouldn’t jump to that conclusion :smile:. It’s just a matter of getting someone who knows about this to answer.
Perhaps @dale can provide a pointer?

I think you can make it automaticly with python or rhinoscript so you only have to click one button.

The problem is that everything should work completely automated, without pushing any button, so after a new IGES or 3dm file has arrived, my pythonscript should trigger and process the data.

Ok, if there is really no way to use Rhino as some server for my requests, I will have to stick with that.

You have not understood what @jordy1989 thinks…
Programing/Run Your script as loop and not close Rhino
Automatic Startup Your script in Rhino…

Which system do you work 32 or 64 bit ?

I think I did understand what jordy meant, that’s why i wrote “i will have to stick with that” :smile:
I just thought it would be more elegant to start the script only when needed and not looping all day long (or checking for new data after some sleep)

I have a 64bit system

I remember it used to be possible, here how it was up to Rhino 4:

Is this dead?

If you create a windows application you can use this yes.
It is not for python scripting because you still have an eternal loop then.

Not, is not dead, i’m use this external ACX access. (That’s a very good interface in Rhino)

  1. Download and install from here:

Download attached file (1.0 KB) (979 Bytes)

2.Install Autoit --> Scite with option Edit Script !!! !!! not Run Script

3.On your desktop create directory named IGS_Files

4.Put there few IGS files (For first test small files !!!)

5.Start Rhino

  1. Unzip, open Scite Editor and load extracted file ArrivedFiles.au3 (Source code)

  2. Press F5 or run script from scite menu --> Tools --> Go

What happens ?
External program is started
Every 20 minutes is checked whether new files arrived in folder IGS_Files
Files older than 20 minutes are ignored !!!
If new file arrived, command is executed, in my example, command Import IGS is used
If sixteen(16) clock is reached, script quit automatically
Exit script manual with RMB over Icon in systray

If everything works test your script
Give your script a command alias and change line like this

$r.Command("YourAlias", False)

Or Pythonscript: Make that Your Pythonscript is on search patch and add this as command

$r.Command("-_RunPythonScript (")  ;;;Not tested

At the end of your script --> do not forget to delete all objects from document !!!

If everything works
You can compile this script as exe file. Ctrl + F7 or menu --> Tools --> Compile

Do not use Obfuscator ore UPX, otherwise your antivirus program will explode

use at your own risk, I do not give liability

Quick tested in Rhino4,
I do not know if LastCommandResult() returns a value when used aliased script

So finito end midday meal…

Wow, thanks a lot for this detailed description!!!

I will try it out as soon as possible.

First sorry for my bad English. (Google translater is my friend)

Here was a little logical bug
I have added two more lines (1.0 KB)
First loop import file that are no older than 20 minutes.
(But “DAY” is not checked, so remove files from previous day)
Next loop imports file that are no older than 20 minutes + Running time from previous loops.
After all loop’s finished, rhino.interface is destroyed, script will pause’s for 20 minutes.
After pause, for next loop new reference to running Rhino will be created, but in this case not ideal.

I have new modified old script, in this case, the object will accessed remain permanently in one same Rhino process. (1.0 KB)

Rhino can be automated, externally using ActiveX.

Here are a couple of examples that demonstrate this using VBScript.]

I don’t know if standalone Python supports ActiveX. But using VBScript, you can launch Rhino and have it run a Rhino.Python script.

Hi Dale, I was trying this automation example:
When trying to create an instance of Rhino it hangs. Task Manager is showing the process Rhino.exe, but from the description it appears to be the WIP. After some time it gives up trying. Do you have an idea how to get it to work?


Well the command is trying to create a Rhino5x64.Application object and (from your screen capture) Rhino 6 is loading which is a problem. Looks like the WIP installer is hosing COM entries in the Registry that were added by the Rhino 5 installer.

To fix, run REGEDIT and navigate to this key:


Modify the entry to point to the Rhino 5 x64 executable.

Thanks Dale!
I was using the interface in the meantime and think I’ll stick with that :wink:

Hi @dale,

the links above to github seem to be dead. I’ve found The TestRhino5Automation.vbs example via google and changed:

Set objRhino = CreateObject("Rhino5x64.Application")


Set objRhino = CreateObject("Rhino5x64.Interface")

My Rhino 5 x64 SR12 is open. If i run the vbs script from a command prompt, it opens Rhino 4 instead, writes the file to the desktop and then hangs. I’ve searched my registry for above key but it does not exist. It also opens a new Rhino 4 when it is already open. How can i change it so it uses the open Rhino 5 x64 instance ?

Here is my vbs: (840 Bytes)

I’ve seen your zip files on YouTrack but i am unsure which one to use to fix this without goofing things up :slight_smile:

EDIT: I’ve found the Rhino.Interface and Rhino.Interface.6 entries, but get same problem, it pops up a new rhino.exe in taskmanager which does not remain open and ignores the allready opened Rhino5 or Rhino 6 instance.


Hi Clement,

I ran the script you reference here and it seems to work. Here the the source, by the way.

If you’ve grepped the Registry cannot find either Rhino5x64.Application or Rhino5x64.Interface then you should probably repair your installation, as these keys are added by the Rhino installer.

Note, Rhino.Interface and Rhino.Interface.6 are for Rhino 6.

– Dale

1 Like

Hi @dale, i guess the problem is my registry, the Rhino5x64.Interface is missing:

I can make it work for an open Rhino4 instance by using: Rhino4.Interface, it works for an open Rhino5 x86 instance by using Rhino5.Interface and for Rhino6 x64 by using Rhino.Interface.6

How can i repair my registry or add the missing keys without too much risk loosing my configuration ?


Hi Clement,

Try right-clicking on your Rhino shortcut and then pick “Run as administrator.” Does that help?

– Dale

Hi Dale, unfortunately not.

I’ve now solved it by creating an ironpython script which i can run with ipy.exe using the clsid 4AD5D33E-7576-4C71-BEDC-E174E5DEF0DA instead of Rhino5x64.Interface:

import System
guid = System.Guid('4AD5D33E-7576-4C71-BEDC-E174E5DEF0DA')
xType = System.Type.GetTypeFromCLSID(guid)
obj = System.Activator.CreateInstance(xType)

This works when Rhino5x64 is open. For Rhino4, Rhino5 x86 and Rhino 6 it seems to accept a ProgID:

xType = System.Type.GetTypeFromProgID('Rhino4.Interface')
xType = System.Type.GetTypeFromProgID('Rhino5.Interface')
xType = System.Type.GetTypeFromProgID('Rhino.Interface.6')

…but not Rhino 5x64. Strange.


1 Like