Grasshopper

algorithmic modeling for Rhino

I am new to coding in VB.NET under Rhino environment although I am not a stranger to Java.

Having been struggling for quite some time to practice my coding skill in GH, I would like to ask for your help/tips regarding some issues.

here is my first issue need to be resolved. Sometimes, it is hard to find appropriate class methods for my tasks. What is your way to tackle this? For example, I need to find method trim to trim two objects. So I searched through SDK, but none of the trims is what I can use. What should I do next?

The attached is the search page I found in SDK.

Hope my request for help make sense for you. Thanks a million.

Views: 336

Replies to This Discussion

If your trying to DO something than the first place to look is the RhUtil class. Most classes in Rhino don't really DO that much, just allow for access/queries to the base objects or "small" modifications. After that, its generally a process of hunting... which method you need to use, what class it will take, then figure out how to get from the class you have to the one that's needed.

In regards to your specific question, you said you'd like to "trim two objects". Without being specific about what those objects are, then I can't help you. I can say that trimming curves must be done manually for the most part. Trimming B-Reps can't be done directly, mainly because of the need to figure out which portion of the b-rep to remove. Also, splitting can only be done with 2 b-reps, not with a b-Rep and a curve, so it might be better to go about things a different way (ie creating an extrusion as opposed to creating some projection curves).

The search in the SDK is practically useless, so don't even give it a second look. It will only frustrate you or lead you down a dead end.
Thx, damien. I originally thought I can search all the classes on SDK. But you say I was wrong? Where should I check the methods/classes on RhUtil class?

I will check again on GH Primer to see any leads. The trim methods is to trim a circle with a curve/line. What do you recommend?

BTW, can you explain a little bit about the process of setting up MS VS express for GH?
Here's some links that I found invaluable when learning the Rhino SDK,

http://www.rhino3d.com/developer.htm

The newsgroup http://news2.mcneel.com/scripts/dnewsweb.exe?cmd=xover&group=rh... has a wealth of history of various users learning and posting questions. Searching for your topic here is a worthwhile first point of call (I'm not sure if the websearch has improved, I use Windows Live Mail as my newsreader and have all headers downloaded to search there).

http://wiki.mcneel.com/developer/dotnetplugins has lots of examples, most of them posted as a result of a newsgroup question.

Hope that helps,

Jon
Hi, Jon:

Thanks for the link. I have begun posing my questions there.
I've just stumbled across this (exactly what i've been looking for) after following Jon's link:

http://wiki.mcneel.com/developer/rhinoscript101

Don't know if it's of any help to you too cmrhm? - i was wondering though if David's Rhinoscript Primer, originally written for version 4.0 is still directly relevant with 5.0? Will it translate to use in GH? I'm very new to this kinda thing.

Thanks in any case David, for what at first glance appears to be an excellent guide.
Hi David,

learning RhinoScript will help you learning scripting and will teach you very interesting programming paradigms, but the syntax is very different in Grasshopper, because Grasshopper is written in RhinoCommon (.Net) and is object-oriented.

- Giulio
______________
giulio@mcneel.com
McNeel Europe, Barcelona
Thanks Giulio,

I'm gradually beginning to comprehend the different spheres of scripting, if only superficially.

I'm looking forward to getting stuck into the Rhinoscript101, but does Rhinoscripting have a future as a way of automating Rhino, or is it likely to be taken over by achieving the same thing via/through GH? - apologies if that reveals the true extent of my naivety!

Thanks,

David.
If everything goes according to plan, users of Rhino.Python will manage to script Rhino for Windows, Rhino for Mac and Grasshopper. All this using the same platform: RhinoCommon.

This is not possible at present, as Vb.Net and C# lack some interactivity features and therefore are not primary choices for scripting programs -- and VbScript/RhinoScript is unavailable on Mac and incompatible with Grasshopper.

So, Rhino.Python + Grasshopper is surely a powerful duo that will give the most flexibility. It will probably take some time before Python is re-integrated into Grasshopper, though.

- Giulio
______________
giulio@mcneel.com
McNeel Europe, Barcelona
The light gets brighter...

Thanks Giulio.
Hi, David:

I will take sometime to check rhinoscript101 again when I got time. Thx.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service