How to write C# components in Visual Studio for Grasshopper?
If you have the Visual Studio community 2017, you have to also download assembler for grasshopper v6.
https://marketplace.visualstudio.com/items?itemName=McNeel.GrasshopperAssemblyforv6
After downloading the file, start it. The VS community 2017 should be chosen automatically.
Now you can start VS 2017 one more time, in the new project, you should find new options:
If you choose Visual C# > Rhinoceros > Grasshopper Add-on for v6, a new window will appear:
The missing files have to be added to references. The RhinoCommon and Rhino.exe you will probably find somewhere on C disc (in my case it is C:\Program Files\Rhinoceros 5 (64-bit) ). The Grasshopper.dll file location you should check on your disc through searching enginge
( in my case it was : C:\Program Files\Common Files\McNeel\Rhinoceros\5.0\Plug-ins\Grasshopper (b45a29b1-4343-4035-989e-044e8580d9cf)\0.9.76.0 ).
Click finish and new empty code should open.
But to build our first component we have to specify one more thing. Go to Project>MyProject1 properties:
Find the ribbon Build and Output path. It has to be changed to your grasshopper component folder.
If you don't know where to find this folder. Open grasshopper and click on component folder:
When the folder will open, copy the address and paste it to Output Path place.
Now you are able to build your first C# component.
If you have the Visual Studio community 2017, you have to also download assembler for grasshopper v6.
https://marketplace.visualstudio.com/items?itemName=McNeel.GrasshopperAssemblyforv6
After downloading the file, start it. The VS community 2017 should be chosen automatically.
Now you can start VS 2017 one more time, in the new project, you should find new options:
If you choose Visual C# > Rhinoceros > Grasshopper Add-on for v6, a new window will appear:
The missing files have to be added to references. The RhinoCommon and Rhino.exe you will probably find somewhere on C disc (in my case it is C:\Program Files\Rhinoceros 5 (64-bit) ). The Grasshopper.dll file location you should check on your disc through searching enginge
( in my case it was : C:\Program Files\Common Files\McNeel\Rhinoceros\5.0\Plug-ins\Grasshopper (b45a29b1-4343-4035-989e-044e8580d9cf)\0.9.76.0 ).
Click finish and new empty code should open.
But to build our first component we have to specify one more thing. Go to Project>MyProject1 properties:
Find the ribbon Build and Output path. It has to be changed to your grasshopper component folder.
If you don't know where to find this folder. Open grasshopper and click on component folder:
When the folder will open, copy the address and paste it to Output Path place.
Now you are able to build your first C# component.
Comments
Post a Comment