Grasshopper

algorithmic modeling for Rhino

When I build a gha in Visual Studio, I then manually copy it over to the Grasshopper Components folder. If grasshopper and rhino are already open, it seems that I need to close and restart both in order to see the results of any changes I make to the gha.

This process is a little tedious. Is there a way to tell grasshopper to reload ghas without having to close Rhino?

Would it be stupid to use the Grasshopper Components Folder as my build path in VS?
Can I have multiple build paths in VS express? Would I just have to edit the xml in the .vbproj file?

Thanks!

Views: 6122

Replies to This Discussion

Hi Benjamin,

here is what I do:

first of all, I setup the project to build only to one folder, both in Debug and in Release.
This is because Rhino can only memorize one location from which to load a specific plug-in, and Grasshopper is able only to load one copy of an add-on at a given time.


(when I use C#)
I set up either one of these two build events:
move /Y "$(TargetPath)" "$(TargetDir)$(ProjectName).gha"
ormove /Y "$(TargetPath)" "C:\PathToComponentsFolder\$(ProjectName).gha"


Then, I make sure that Rhino can be started with the "Play" button:


You need to follow the instructions here to make this possible. Read the paragraph where it says "THIS FILE".

I setup the Rhino _GrasshopperDeveloperSettings command not to memory-load using byte array:


Then, I try using Edit-And-Continue all the time in VS.

Basically, you hit the pause button and then change the code. If the code compiles and you only change the inner body of "normal" methods, then you do not need to ever restart Rhino. This is very useful to get the first part of a program working, and then refine it.
Also, check for which exception throwing you want to break (in Debug -> Exceptions in VS).

See also "Project setup" in the Grasshopper SDK help file (_GrasshopperGetSDKDocumentation command).

I hope this helps,

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
It is super helpful!
. . . and it shows that I should stop using the express version of visual studio.
you can only do these with the paid version of visual studio, correct?

But to clarify:
when you use the "play" button, it starts rhino with a window, and you can interact with that rhino document as you might normally?
For example, you could hit "play", test your gha, model a new curve in rhino, then edit your gha and test it again?
nope, you can do this with Express versions as well...
The pictures above are from Visual C# Express 2008.

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Oh!! cool!! Thanks.
To enable the different configurations in the first picture, choose "Show all settings", then "Projects and solutions", then "Show advanced build configurations".


- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Giulio, I've just set up all of this. Thank you again for the detailed description, it was extremely helpful. I'm transitioning to C# too now. I like that it is based on ECMA so it is closer to other languages I am currently learning.

Since I had never used GrasshopperDeveloperSettings, it took me a while to realize that it was just a command you type while in Rhino. So if someone is reading this and learning for the first time, just type "GrasshopperDeveloperSettings" into the command line of Rhino.
Yep, sorry. Every time I wrote a name with an underscore in front, it is a Rhino command. I'll edit it.

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
No worries. I should have been able to figure it out.

Hello Giulio,

this maybe a bit old post, but I am trying "Edit and Continue" and have a "Changes to 64-bit applications are not allowed" message when I hit pause button and try to change my code. Also my classes are "read only" with a small lock beside in VS.

Is there a way to remedy that ?

Except that the debug process works good.

I am using Visual Studio 2010 and Rhino5.

thank you.

Hi guys,

I'm having issues debugging some code. Every single breakpoint I set turns into a hollow circle with a warning saying: "The breakpoint will not currently be hit. No symbols have been loaded for this document." as soon as I step into debugging mode. I've tried with some other code but still getting the same warning.

By the way, everything Giulio described in the thread is working fine, it's just the debugging part which is refusing to work properly. Ah, using Visual Studio 2008 (although I still have VS 2010 installed. I know there are some debugging issues with 2010, should I remove it completely?).

Cheers!

r
Hey Riccardo,

Can you make sure that the "Memory load..." checkbox in _GrasshopperDeveloperSettings is filled?

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service