i want to develop a C# component for rhino 5, but cannot find the project template in V5,only v6 exists.
thank you!
I think itâs quite hard to find nowadays (I didnât manage last time I looked for it) but you can use v6 template. You just have to change some references when setting up the project :
- Grasshopper.dll and GH_IO.dll being at : C:\Program Files\Common Files\McNeel\Rhinoceros\5.0\Plug-ins\Grasshopper (b45a29b1-4343-4035-989e-044e8580d9cf)\0.9.76.0
- Rhinocommon.dll being at : C:\Program Files\Rhinoceros 5 (64-bit)\System\
- Start up program : C:\Program Files\Rhinoceros 5 (64-bit)\System\Rhino.exe
Hope this helps
â Xavier
thank you Xavier!
Hello,
https://marketplace.visualstudio.com/items?itemName=McNeel.GrasshopperAssemblyforv5
https://marketplace.visualstudio.com/items?itemName=McNeel.RhinoCommontemplatesforv5
Hello @TomTom, those two templates are not compatible with Visual Studio 2017 But I agreee with you, it will do the job for VS2015 and older versions.
There is no explicit template for 2017 and v5.
You can also follow grasshopper.chm to manually setup with vs2017, which
shows you how to do these steps manually:
Enable DotNet Framework 4.0 (no C# 6.0+!)
Reference needed dlls, like Xavier said,
Setup build location, auto-rename your .dll to .gha. Use a post build macro for this.
Create a custom guid for your component
thank you
Although I mostly use 2015 (which works with the R5 template) I still often copy other components and start from there. Most often I copy a component with lots of ports, and delete the port types that I donât need for the new one. Faster than starting from a fresh template which is essentially empty.
This trick comes with all the copy-paste errors included.
// Rolf
@RIL, youâre definately right!
It comes as well with the forget-to-change-the-GUID-when-copying error when you start GH
thatâs why it helps you to know what such a template actually is doing, by doing it manually at least once.
To not know whatâs going on is actually more dangerous as using a wrong guid once. I believe Rolf is one of these guys who doesnât make these mistakes anymore.
If you donât know about GUIDs, it may be better to learn basic programming first, otherwise you end up with much more complicated and weird errors. And setting up an own project without a template isnât that difficult, especially when its well documented.
I never did that mistake. And I donât do bugs either.
// Rolf
template for v6 in VS2017 works fine for Rhino5 as well. It is what I use. No additional steps are needed.
Hey Michael, out of curiosity, do your âReferencesâ for RhinoCommon.dll and Grasshopper.dll in VS refer to your respective Rhino 5 and GH 5 folders in your template? Because by default, mine refer to GH and Rhino 6, and it does not work in 5 for me using the v6 tempate in VS2017. My default path is:
C:\Program Files\Rhino 6\Plug-ins\Grasshopper\Grasshopper.dll
I found out my .gha wasnât working in Rh5 when I shared it with others and they couldnât use it in GH for 5. Iâm considering switching my reference paths so it can work in both, but havenât decided yet.
Yes, if you reference RhinoCommon.dll, Grasshopper.dll and remove Eto references, use .Net 4.0 then your GHA can load in Grasshopper for Rhino 5 even if you used the Rhino 6 wizard.
Hi all,
If I use the v6 template for rhino 5, I have warnings (not errors). The compilation is performed correctly. Alerts can be a problem? âThe component âEtoâ and âRhino.uiâ could not be foundâ.
Thanks