Your First Python Script in Rhino (Mac)
This guide covers the basics of getting started writing Python in Rhino for Mac.
Running a Python script
To get acquainted with how Python scripts can help you model first run some of the sample scripts that are provided.
- In the Command prompt edit box (top left by default) type the RunPythonScript command.
- If it’s the first time you run this command the dialog box that comes up will show the files in the samples directory. If it’s not then navigate to it. It should be under:
(the beginning tilde (~) character is normally in the far upper left of the keyboard).
- Experiment by running HelloPython.py
Editing a Python Script
You can open any of the sample Python scripts in a text editor. From Finder navigate to the samples directory:
(replace HOME with your home directory name).
Or in the Finder, use the Go pulldown > Go To Folder… and type:
Right-click on any of the scripts and from the context menu that pops up select Open With -> TextEdit.app which is the text editor that comes with macOS. You can try editing and saving the files and then re-run them in Rhino with the
After you’ve followed the above links and setup Atom the next step is to get familiar with the different application programming interfaces (API) you’ll need to write scripts that interact with Rhino.