Example on how to use GH_IO.dll - Grasshopper2024-03-29T06:39:43Zhttps://www.grasshopper3d.com/forum/topics/example-on-how-to-use-gh-io-dll?commentId=2985220%3AComment%3A723320&x=1&feed=yes&xn_auth=noHi Tanir,
note that GH_IO.dl…tag:www.grasshopper3d.com,2012-10-22:2985220:Comment:7108152012-10-22T09:33:43.706ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>Hi Tanir,</p>
<p></p>
<p>note that GH_IO.dll does not represent the GH/GHX file formats, nor does it contain tools for editing GH/GHX files.</p>
<p></p>
<p>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.)</p>
<p></p>
<p>What you can do with GH_IO.dll is read a gh/ghx file and get a runtime…</p>
<p>Hi Tanir,</p>
<p></p>
<p>note that GH_IO.dll does not represent the GH/GHX file formats, nor does it contain tools for editing GH/GHX files.</p>
<p></p>
<p>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.)</p>
<p></p>
<p>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.</p>
<p></p>
<p>The basic building-block of this database is called a <em>Chunk</em>. A Chunk contains any number (zero to Int32.MaxValue) of <em>Items</em> 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.</p>
<p></p>
<p>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.</p>
<p></p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p>