algorithmic modeling for Rhino
Hi,
Does there exist a way to debug rhinocommon scripts for Rhino 5.0?
I found that components in grasshopper can't figure out syntax errors before I hit Ok button, and navigating in grasshopper C# or VB.NET components seemed to be quite inefficient when there are more than one thousand lines of code. VS2010 could give me a pleasant journey when I wring code but seem to be impossible to figure out some non-syntax errors that generated by rhino. Is there a way to run the scripts in Rhino just by hitting the "debug" button on the toolbar of VS2010?
I know there is a hybrid way of writing codes in VS and copying them back to Grasshopper component but this seems to be quite laborious and not all codes can be dealt with in this way since grasshopper component does not accept multiple classes in one single component.
Meanwhile, writing codes in VS could ensure the possibility of developing it as a Rhino plugin and also have a potential to enjoy those .net 4.0 new features.
Anyway, in one word, is there an easy way to detect and debug all the syntax and non-syntax(errors that generated by rhino) in VS2010? or, even further, to run the scripts in rhino viewport just by hitting the "debug" button and trap errors that generated?
Thanks,
Jerome
Tags:
Hi Jerome,
not really. Grasshopper is written in VS 2008 and compiled against .NET 3.5
I do all my debugging in a similar setup. Once Rhino5 is released we'll drop support for Rhino4 and switch over to VS2010 and .NET 4.0
I'm looking forward to this as it will both simplify the distribution of Grasshopper and it will give me some additional cool stuff to play with.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Once Rhino5 is released we'll drop support for Rhino4 and switch over to VS2010 and .NET 4.0
What a great incentive to upgrade!
Isn't it just...
--
David Rutten
david@mcneel.com
Poprad, Slovakia
RMA is partly employee owned, but unfortunately I'm not an employee, so no.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks, David.
I'm looking forward to the new release and more cool stuffs like Galapagos.
:)
Thanks,
-Jerome
I'm installing 2012 express now to test.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
It works just fine using Visual Studio Express 2012.
Do be sure to uncheck the Memory Load option in _GrasshopperDeveloperSettings otherwise debugging will never work.
I attached the entire project in case you want to have a look.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
I think that you cannot change that: if you hit Debug, VS runs Rhino and GH. When you hit stop, everything is closed. Try to use Pause button, perhaps it could help a little letting you change some code (as far as I remember...I need to go back to coding again ;))
Unless you can get Edit-And-Continue to work (which I have never been able to) you have to close Rhino, rebuild the project, start Rhino again.
I know this is annoying, but on the other hand if you're hitting breakpoints then I find it's usually just a matter of debugging once until you find the problem.
If regular breakpoints get hit too often, you can always put a condition on a breakpoint. That is a very useful feature when you have to debug a line that gets called a lot.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
If you want to start Rhino, start Grasshopper and load a GH file from within Visual Studio then I think you'll need to use Rhino command line arguments. I've never done this before though, no idea if it will work.
You'll probably want to add /nosplash and /runscript
Since the script you're running will involve RhinoScript calls you may want to create an *.rvb file on your desktop (or some other easily accessible location) that does all the loading. Then invoke this script via the command line arguments.
I'll see if I can get something working.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by