Grasshopper

algorithmic modeling for Rhino

Hi,

The last time I built a GHA was in May 2013. I was going to work on a new GHA today and I noticed the references to Grasshopper and Rhino are not valid anymore. I suspected that this is because the new Rhino 5 and the new grasshopper plugin; but I couldn't find a way to import Rhino and Grasshopper. I mean, when I browse in VS (Add Reference/Browse), I cannot find anything suitable neither in my program files Rhino folder nor in the Grasshopper folder. 

I also came across this thread, but didn't really find a solution there: 

http://www.grasshopper3d.com/forum/topics/visual-studio-grasshopper...

I better add that, when I used the solution proposed by Giulio, my VS crashed somehow. It was my mistake though; because it was referring to Rhino4, which I don't have it installed anymore. 

Does anybody know how I can add them back as my references? Any help is very much appreciated!

Views: 1747

Replies to This Discussion

Hi Pirouz,

You need to find RhinoCommon.dll and Grasshopper.dll (with GH_IO.dll) after choosing "Browse".

Rhino 5 64 bit on my system is located in:
%programfiles%\Rhinoceros 5.0 (64-bit)\System\
Here I have RhinoCommon.dll.

And the latter file is in: %appdata%\McNeel\Rhinoceros\5.0\Plug-ins\Grasshopper {B45A29B1-4343-4035-989E-044E8580D9CF}\0.9.61.0\

I hope this helps

Giulio

--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Guilio, 

Thank you very much for your response. It was actually a funny issue with the location of my Grasshopper and Rhino on my hard drive. I have them referenced now; but I was wondering if you are going to update the template you had prepared for GHA files sometime. It doesn't work with my VS 2012 and I don't have a VS 2010 to install. When I open the last GHA project I had written using your template my VS crashes. That template was a great starting point indeed!

Thanks for reminding me, Pirouz :)

I've actually updated these templates -- Grasshopper addons and RhinoCommon plugins:

https://github.com/mcneel/RhinoCommonTemplatePackage
https://github.com/mcneel/GrasshopperTemplatePackage

I think Steve wanted to add some minor changes to the RhinoCommon one, and we need to make small changes to the Grasshopper one because we recently switched to .Net 4.0

Otherwise, they should be ready for the next release.

Thanks,

Giulio

--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Guilio,

Thanks for letting me know! BTW, could you please explain how I can generate an error message in VS? I have found the "AddRuntimeMessage" Sub; but I don't know how I can trigger this method in case, for instance, an input fails to receive data or its data count is not matching with some other input. Because, in this case, those input parameters are in the scope of the SolveInstance Sub and not this sub; so I cannot refer to them. 

Public Overrides Sub AddRuntimeMessage(level As GH_RuntimeMessageLevel, text As String)
 MyBase.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "number of labels and points must be equal")
End Sub

The thing is, when I noticed your response I had already made a template by my self and I didn't manage to use your template. Maybe I am missing some very important adjustment, which is already in your template!?

Thanks for your time,

Pirouz

That method is supposed to be called from SolveInstance. You do not need to override it. So you can just write:

AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "number of labels and points must be equal")

from within SolveInstance (probably from inside an "If")

I hope this helps,

Giulio
--

Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Guilio,

Thanks a lot! this is exactly what I was looking for! 

Cheers,

Pirouz

Dear All,

The grasshopper version 0.9.76.0 I found under following path:

C:\Program Files\Common Files\McNeel\Rhinoceros\5.0\Plug-ins\Grasshopper (b45a29b1-4343-4035-989e-044e8580d9cf)\0.9.76.0\Grasshopper.dll

What also could be helpful is to switch first to the framework 4.0 and add references after. 

Best

Dimitry

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service