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: 6001

Replies to This Discussion

Hi Giulio, nice to hear from you.

The "Memory load.." checkbox is unchecked. Which means that when I press Play in VS Rhino gets started, and when I load _GrasshopperDeveloperSettings the "Memory load.." is unchecked.

I've placed breakpoints everywhere in the code, just to make sure it might break somewhere but nope, nothing happens. I've been reading something about this issue on a blog and they were suggesting to see whether the project's .dll (I bet in our case .gha?) under Debug -> Windows -> Modules states 'Cannot find or open the PDB file.' which is exactly my case. I was wondering if this might be the reason.
1) In the bin folder, do you have two files:
- one is the .gha
- one is the .pdb ?

2) In the Build tab of the project properties in Visual Studio, in Advanced, do you see: "Debug info: Full" or "Debug info: pdb"?

3) In the Debug tab of the project properties in Visual Studio, do you have: "/dotnetversion=2"?

Thanks,
- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
so, situation is as following:

1) In the bin folder, do you have two files:
- one is the .gha
- one is the .pdb ?


No, in the bin I've only got the .pdb file, as the .gha has been moved to the Grasshopper\Components folder through the post-build event.


2) In the Build tab of the project properties in Visual Studio, in Advanced, do you see: "Debug info: Full" or "Debug info: pdb"?

"Debug info: Full"


3) In the Debug tab of the project properties in Visual Studio, do you have: "/dotnetversion=2"?

I don't know whether I'm looking in the right place, but I can't see the debugging version:

Ok, if this was Rhino 5, this line would be necessary:

/dotnetversion=2
inside "command line arguments".

Inside Rhino 4, I think not...

Which version of Visual Studio is this?
Thanks,
- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Thank,.
It's Rhino 4 and Visual Studio 2008. I'm trying to getting it to work on another computer without VS2010 installed on it, I wonder if they're somehow conflicting. I'll let you know soon if this has solved the problem.

r
Hi Riccardo,
Having VS2010 installed should make no difference. Are you sure the GHA that grasshopper is the one that you just compiled? Try adding some new code to your GHA so you can be absolutely sure that the GHA loaded is the one just created by the compiler (something obvious just for testing.)
Thanks,
-Steve
Hi Steve, Hi Giulio,

I've managed to solve everything in the end. It was nothing too transcendental or complicated, it just took me a long, looong time to figure it out. Basically I was building my solution in the Grasshopper\Components folder and not into the Grasshopper\Libraries folder as specified in the _GrasshopperDeveloperSettings. Such a dork.. All's well that ends well at least.

By the way, just out of raw curiosity, how come without COFF enabled all the default Grasshopper components in the Grasshopper\Components folder get loaded but the external components only in the Libraries folder?

Cheers!

r

Well...I am sorry...this is really really making me despair...My configuration is totally according to the description of this thread, but nothing...No breakpoint hit when testing my fancy .GHA components..

I have even tried SharpDevelop, MonoDevelop and Visual Studio (not Express Edition), but to no avail, and the information I am finding is very confusing...

Could someone confirm if is there or is there not the possibility of debugging .gha components with breakpoints and watches and all the tools that come with professional IDEs or should I just abandon?

 

Currently I have tried all the configurations suggested and as SharpDevelop and MonoDevelop claim that they have no support for debugging .dlls and VBExpress requires a proper hack (very clever by the way), now I have set Visual Studio as follows:

 

  • The target path for either debug and release configurations points to a folder called /Libraries in the GH folder, not the default /Bin (so I can develop in the future more components and there is no need for build events)
  • The targeted .NET Framework is 3.5, as is the only one that doesn't give compilation problem and also is read by GH (version 4.0 is not recognized)
  • Regarding the external program, i have observed a curious phenomenon, as in VS it is possible to either attach to a running process (i.e. rhino with GH already loaded) or to set it in the debug configuration as start application. The only one that actually activates the modules and recognizes my .gha file is the second procedure, but with no results either...

Any help please?

 

Thanks very very much

 

Ra

I have to ask Ra, are you sure that the "Memory load *.GHA assemblies using COFF byte arrays" option in the GrasshopperDeveloperSettings is unchecked?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David:

Sorry I didnt mention in the post..yes, that is also accordingly set up. It is unchecked...

What can possibly be happening?

 

Regards

 

Ra

P.S: Thanks a lot for the quick response!

Oho!I made it work!

After hours of experimenting and combining configurations, it has just happened.

The procedure goes as follows:

  • Once evertything is configured as explained in the previous posts of this thread in Visual Studio 2010 (not Express Edition), I clean the destination folder (..\Rhinoceros 4.0\Plug-ins\Grasshopper\Libraries) so there is no .gha nor .pdb files of the component I am working on.
  • I build the component and then the newly created .pdb and .gha files are synchronized
  • I start Rhino and GH, and create a definition containing my component
  • In Visual Studio, go to Tools/Attach to process (Ctrl+Alt+P), and search for the running Rhino
  • I close the definition previously loaded, load it again and..tachaan!! The debug points work!!

I have restarted the computer a couple of times to make sure it wasn't pure coincidence, but still keeps working, which means that this is not any kind of black magic...Though is looks pretty much it is I must say...

Anyone with further knowledge can give a scientific explanation of this phenomenon? I am totally astonished...

 

Thanks in advance

 

Ra

I also seem to be encountering problems with this -- I'm getting a very weird error using VS Express 2010 with Rhino 4: It's unable to load my assemblies stating:

Could not load file or assembly 'file:///filepath\filename.gha' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Anyone know a fix to this? I'm compiling for Grasshopper 0.8.01.

Many Thanks.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service