algorithmic modeling for Rhino
We are trying to manipulate GH files from an external C# application.
I saw the post on : http://wiki.mcneel.com/labs/grasshopper_fileformat
concerning GH_IO.dll which say:
"..You can reference this library from any DotNET assembly since it only depends on standard System namespaces. Library is fully documented."
However, I could not make it work. For some reason, the code in GH_IO.dll can not be accessed.
Can you please upload the simplest C#/VB application (project) that uses GH_IO.dll to open/modify GH files?
note that GH_IO.dll does not represent the GH/GHX file formats, nor does it contain tools for editing GH/GHX files.
GH_IO.dll is only a type-safe, hierarchical database which can (de)serialize itself to xml and binary streams. Grasshopper uses GH_IO.dll to write almost all of its files (gh/ghx, settings, canvas skins, MRU data, Markov-chain data, etc. etc.)
What you can do with GH_IO.dll is read a gh/ghx file and get a runtime representation of that file in the aforementioned type-safe, hierarchical database format.
The basic building-block of this database is called a Chunk. A Chunk contains any number (zero to Int32.MaxValue) of Items and sub-chunks. An Item is a named value, which can have an optional index as well. So multiple items can share the same name, while being only differentiated by their indices.
I attached a gh file with a C# component that reads a Grasshopper files, replaces a bunch of characters in object names and then saves it under a different name. You can use TestFile.gh to try it out.
Thank's it's ok for me, just errors but i suppose you have compiled the 15th version.
I'd like to ask you if is it possible to generate binaries like this, the goal is to generate pdf with a "write" method (which is a byte sequence). I have the pdf reference 1.4 book and i'd like to do a first simple library.
I didn't see byte object in the panels (?).
Any idea ?