I’m trying to do something really simple, namely run Rhino from windows command line with some arguments:
.\Rhino.exe /nosplash /runscript=“!-_RunPythonScript (C:<path_to_python_script>\script.py)” C:<path to input file>\rhino-testbench.3dm
What I want to achieve with this is to:
Launch Rhino 6 → works
Open the input 3dm file I provide → works
Run the python script I provide → does not work
Rhino 6 does not run the script. it’s doesn’t to anything and the console does not show any information whatsoever. It’s like it’s ignoring the /runscript part entirely. In fact, this official doc here Rhino - Running Rhino from the Command Line does not work either. I see it’s Rhino 5, but I’m running Rhino 6.
Does this mean, I cannot use Rhino 6 to run python scripts from the command line?
Also, I tried pasting !-_RunPythonScript (C:<path_to_python_script>\script.py) in Rhino’s command line to check if there’s something wrong with it, and it’s not. It runs the script as it should. So this makes me think the problem is elsewhere. Is there a verbose mode I can launch Rhino 6 with to see what’s going on?
I would really appreciate some help here because I’m currently relying on this automation in order to have things working.
Thank you for your response, but unfortunately it does not work. The same thing as before is happening. Rhino starts, loads the provided input .3dm but does not run the script. And it does not provide any information in the console. Also, like I said before, pasting:
-_RunPythonScript <path_to_python_script>.py
Inside Rhino’s command line while running runs the script perfectly fine…
Thank you for your response. After several other attempts, it looks like the issue I’ve described in my previous posts was because I was running the command from windows PowerShell… When running it from the command line(cmd.exe) it runs fine.
Hi Dale, is it possible to do the same without launching rhino again if it is already open?
in my case i am using Popen from subprocess to call the script from python.
Thanks
If you are interested you can have a look at this visual studio code extension, it launches your script dynamicaly.
Name: RhinoPython
Id: designtoproduction.rhinopython
Description: A Visual Studio Code extension to program IronPython for rhino.
Version: 0.1.11
Publisher: Design-to-Production
VS Marketplace Link: RhinoPython - Visual Studio Marketplace