Grasshopper

algorithmic modeling for Rhino

Hello everyone (especial David I guess),

I was thinking about writing a little script that would randomly generate GH-Definitions from a view parameter. The idea was to use a simple js to generate some xml code and then open it in Grasshopper.

When doing a little search in the Forum I came across the following post:

http://www.grasshopper3d.com/forum/topics/ghx-files-the-technical-d...

Now I was wondering if this idea could be realized (i.e. VB) using the GH_IO.dll;

Maybe you can give some hints:

  • if someone has done this before
  • where I could find an example file about the saving routine in GH since as fare as I understood this is done with the GH_IO.dll;

thx

Richard

Views: 723

Replies to This Discussion

Aside from David, you probably want to talk to Andrew. He's done some cool things with gh-generated panels and such. http://www.grasshopper3d.com/profile/AndrewHeumann

Hi Richard,

GH_IO.dll is used to write gh and ghx files and read them back in into a hierarchical database of type-safe entries. There's nothing particularly 'grasshopper' about GH_IO.dll, it can be used to (de)serialize all kinds of different data.

The easiest way to create a random Grasshopper file would be through the Grasshopper SDK, but that involves starting Rhino and Grasshopper first, so it may not be what you want.

Andy's approach of creating xml from templates will also work, but it's easier for singular objects such as panels and sliders than components. 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Starting Rhino and Grasshopper wouldn't be a problem.

The js-script / xml Idea just came to my mind because I wasn't shure how to automatically generate new components and link it with an other component in Grasshopper

-> which was also the discussion in the post I was revering to.

So I could use the  "GH_Document" Class and start adding Components, linking them, doin...

Adding objects is easiest via the Canvas.InstantiateNewObject() method, but you can also add objects directly to the document using GH_Document.AddObject(). See attached. Creating connections between objects is done by calling AddSource on an IGH_Param instance.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

thx, that helped a lot

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service