RhinoPythonForVS
RhinoPythonForVS is a plugin to allow you to code Rhino python script in Visual Studio, the world's best IDE!
However, if you prefer VS Code, there is a RhinoPythonForVSCode plugin.
It is a DesignToProduction open source project, programmed initially for internal use.
Features
Super powerful IntelliSense in realtime. Much faster and responsive than the VS Code Demo
Requirements
This is the client side of RhinoPython editor. To bridge it to Rhino you need a server to listen to Visual Studio, which is another plugin called CodeListener.
Installation
- Make sure you have IronPyton 2.7.5 installed (.msi file). Note: The latest version 2.7.9 is buggy, tested by author.
- Make sure you have Visual Studio 2015 installed. Note: VS2017, VS2019 are not tested yet.
- Make sure you have PTVS(Python Tools for Visual Studio) installed.
- Make sure you have CodeListener plugin for Rhino in CodeListener latest release installed. Note: You have to download the CodeListener.rhi file for the first time installation.
- Install latest RhinoPythonForVisualStudio from VisualStudio Market Place or Github
Preparation
OBSOLETE (No need to prepare this from Version 0.0.3)
- Copy desired .dll libraries under
C:\Program Files (x86)\IronPython 2.7\DLLs
folder. e.g. Copy RhinoCommon.dll fromC:\Program Files\Rhinoceros 5 (64-bit)\System\
and System.Drawings.dll fromC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\XXX
- Copy all files from
C:\Users\jch\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib
intoC:\Program Files (x86)\IronPython 2.7\Lib\
folder. Note: the site-packages folder seems can't invoke intellisense, tested only by author. - Start Visual Studio, click Tools -> Python Tools -> Python Environments, from the Python Environments window on the right side, select IronPython 2.7, switch from Overview to IntelliSense, click Refresh DB
Usage
OBSOLETE (<Version 0.0.3)
- Start Rhino, type command
CodeListener
- Start Visual Studio, create a new IronPython Application project.
- Right click on Search Paths In Solution Explorer and add folder to the path if you want to add extra library.
- When finished coding, click RhinoPython -> SendCode/SendCodeWithoutReset or Shift + F2 to run code in Rhino.
- Feel free if you want to custom you own shortcut for the commands.
from Version 0.0.3
- Start Rhino, type command
CodeListener
- Start Visual Studio, create a new RhinoPythonApplication project under Python.
- Click RhinoPython -> ImportManager, here you can set python lib path, and check referenced DLL. (see help on that window)
- Remember to
Reload Project
from ImportManager after first init of project or changed module search paths. - When finished coding, click RhinoPython -> SendCode/SendCodeWithoutReset or Shift + F2 to run code in Rhino.
Known Issues
- The debugger has not implemented yet.
- It only supports one Rhino instance at a time. If you want to switch Rhino instance, either close the former Rhino instance or command
StopCodeListener
on the former one.