i want to develop a C# component for rhino 5, but cannot find the project template in V5,only v6 exists.
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
thank you Xavier!
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
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.
@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.
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.
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”.