What is it? Script-sync plug-in to run C# and Python (IronPython or CPython) scripts directly from VSCode into Rhino and Grasshopper. This project is a research utility from the IBOIS lab at EPFL. It was developed and currently maintained by Andrea Settimi.
Why Script-sync? Although Rhino8 has a wonderful IDE, we often miss the nice extensions and functions of a full-fledged IDE like VSCode. Script-sync allows you to run your scripts directly from VSCode, while keeping the Rhino/Grasshopper environment open. This is particularly useful if you have AI-assisted (e.g. GithubCoPilot) code completion.
You can execute the folloing languages from VSCode with script-sync:
CPython | IronPython | C# | |
---|---|---|---|
Rhino | ✅ | ✅ | ✅ |
Grasshopper | ✅ |
![](https://private-user-images.githubusercontent.com/50238678/292775158-7ccb2aa5-e646-45cd-9657-95776d24a48a.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NzgzNzcsIm5iZiI6MTcyMzg3ODA3NywicGF0aCI6Ii81MDIzODY3OC8yOTI3NzUxNTgtN2NjYjJhYTUtZTY0Ni00NWNkLTk2NTctOTU3NzZkMjRhNDhhLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDA3MDExN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwZDJmYzIyM2YwZjhlNzI4NTYxNzZjMDE3ODViMzUwYWEzYThmMjY4YTkyM2RlNTZlMTg4MjM0NDEyZTkwMmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.cA53ra3pq_SQ8QbrUD63xvtJcnYkK9YESpICmC58n84)
🦏/🦗 Rhino/Grasshopper
: Install script-sync rhino from food4rhino or the packageManager in Rhino (name: "script-sync"). For Grasshopper you might want to get rid of the old version of the plugin before installing the new one. Just right-click on the old icon and click delete.
👩💻 VScode
: Install script-syncVSCode extension from the VSCode extension marketplace (name: "script-sync")
🦏 Rhino
: To start script-sync
in RhinoV8, run the command ScriptSyncStart
in RhinoV8. This will start a server that listens to commands from VSCode.
To close script-sync
in RhinoV8, run the command ScriptSyncStop
in RhinoV8.
🦗 Grasshopper
: To start script-sync
in Grasshopper, add the component script-sync: btn
: click to open a file explorer and connect a script, x
: classical input parameter, you can add more, stdout
: all errors and print() is deviated here, a
: classical output parameter, you can add more.
👩💻 VScode
: Open a script in VSCode and run it in RhinoV8 by pressing F4
to run in Rhino or shift+F4
for Grasshopper.
For Python files, add a shebang
to the first line of the file to specify the interpreter to use, e.g.:
#! python3
to interpret it with CPython⚠️ #! python2
to interpret it with IronPython (only in Rhino)
The plug-in needs to be installed on RhinoV8, Grasshopper and VSCode
There is no intellisense for C# and Python in VSCode. In addi
For bugs open an issue on the GitHub repo.
All contributions are welcome. Have a look at the contribution guidelines.
There are a lot of plug-ins that allow to run Python in Rhino. Among them, CodeListener was working until RhinoV8 and it was a source of inspiration for this project. This is a simplified version, but it can run C#
and both IronPython
and CPython
in RhinoV8.
Follow the instructions in RELEASE.md to release a new version of the package.
- publish yak package + auto pipeline
- publish on tools website lab
- add instructions for dev and contribution
- write ci
- write tests
- ci action to publish automatic releases
- possibly redirect output from RhinoApp.RunScript() to vscode consoles or log file
- add intellisense for C# and Python Rhino in vscode
- (optional) add C# support for Grasshopper