Running a Python script in Rhino
This guide demonstrates how to run a Python script in Rhino.
The RunPythonScript command is used to execute script subroutines that were loaded into the Python engine.
The RunScript dialog box will display a file dialog box. Select a Python file (.py) to run in Rhino. Simply select the python file and hit OK. The Python script will run.
Scripting the RunPythonScript command
As is the case with most Rhino commands, the RunPythonScript command can be scripted, thus bypassing the interactive dialog box. To script the RunPythonScript command, simply precede the command name with a hyphen when entering the command on Rhino’s command line. For example:
After entering the command, you will be prompted to enter the name of the script to run.
Assigning the RunPythonScript command to a button.
The RunPythonScript command can also be assigned to command aliases or to a toolbar button.