I’m following the following instructions to run Rhino from the command line:
I’m doing this on Windows 7. Specifically, I am opening a set of files in sequence and running a script on them. I figured out this was the correct formatting, and this .bat content works well:
FOR /L %%x IN (1,1,70) DO (
“C:\Program Files\Rhinoceros 6 (64-bit)\System\Rhino.exe” /runscript="-RunPythonScript my_script.py -exit" filename_%%x.3dm
However, when Rhino exits, my script modifies the file, so the “save changes” dialogue opens. Is there a way to suppress this message (i.e. force either “yes” nor “no”)? Otherwise I have to sit and play whack-a-mole when the dialogue appears.
Try adding “_Save” either as part of the command line or the python script (rs.command).
rs.Command("_Save ", False);
Thanks, this is very helpful.
I actually need to go a step further. I’m running the script on Rhino 3 .3dm files. This means there is a further dialogue even with this command where I’m asked if I want to save as version 3 or version 6.
Is there a way to suppress this? Or perhaps it would be easier to perform a batch conversion separately?
There is always “_SaveAs”, if you type in “-saveas” in the rhino command you can see what parameters are available and try them out as you can combine them into one string.
rs.Command("_-SaveAs " + newFilename + " _Enter", True);
There is a parameter called “version”, so probably you just have to give the value 3 to that parameter.
Thanks, it looks like modifying my python script is an effective approach for this.