Key/Value User Text Within Grasshopper Document? - Grasshopper2024-03-29T07:27:02Zhttps://www.grasshopper3d.com/forum/topics/key-value-user-text-within-grasshopper-document?feed=yes&xn_auth=noThanks Mostapha and Anders!…tag:www.grasshopper3d.com,2014-07-18:2985220:Comment:11034962014-07-18T16:27:19.017ZBrian Ringleyhttps://www.grasshopper3d.com/profile/bringley
<p>Thanks Mostapha and Anders!</p>
<p></p>
<p>I'm pretty familiar with <a href="http://www.grasshopper3d.com/forum/topics/pulling-grasshopper-metadata-document-properties" target="_blank">reading metadata</a> but it seems like I could append multiple strings together representing difference document property fields, write them to an existing property field such as description, and then call them individually using Anders' dictionary method.</p>
<p></p>
<p><strong>So here's the catch</strong>: I…</p>
<p>Thanks Mostapha and Anders!</p>
<p></p>
<p>I'm pretty familiar with <a href="http://www.grasshopper3d.com/forum/topics/pulling-grasshopper-metadata-document-properties" target="_blank">reading metadata</a> but it seems like I could append multiple strings together representing difference document property fields, write them to an existing property field such as description, and then call them individually using Anders' dictionary method.</p>
<p></p>
<p><strong>So here's the catch</strong>: I don't want to overwrite any existing property fields so writing to any available fields in <span>Grasshopper.CentralSettings is hypothetically off limits. I want to define my own custom fields (which of course do not need to display in the Grasshopper Settings GUI but I should be able to call nonetheless). I didn't think it would be possible to create something like Grasshopper.CentralSettings.BriansEsotericDataNeeds which is why I was wondering if Grasshopper had any place to store generic metadata (all strings in my case) like Rhino's "SetDocumentUserText" command.</span></p> Added a version where the "me…tag:www.grasshopper3d.com,2014-07-18:2985220:Comment:11036432014-07-18T15:17:49.241ZAnders Holden Deleuranhttps://www.grasshopper3d.com/profile/AndersHoldenDeleuran
<p>Added a version where the "metadata" is converted to a dictionary (Pythons key/value data type).</p>
<p>Added a version where the "metadata" is converted to a dictionary (Pythons key/value data type).</p> Depending on the data type (i…tag:www.grasshopper3d.com,2014-07-18:2985220:Comment:11036382014-07-18T15:01:57.897ZAnders Holden Deleuranhttps://www.grasshopper3d.com/profile/AndersHoldenDeleuran
<p>Depending on the data type (i.e. strings) you could use the <span id="nsrTitle"><em>GH_Document<span class="languageSpecificText"><span class="fs">.</span></span>Properties</em> property for persistent metadata. Not sure if that is what it is meant for, but it seems to work. See attached definition. Also, credits to Mostapha for figuring out how to get the Grasshopper document using Python a while back :)</span></p>
<p>Depending on the data type (i.e. strings) you could use the <span id="nsrTitle"><em>GH_Document<span class="languageSpecificText"><span class="fs">.</span></span>Properties</em> property for persistent metadata. Not sure if that is what it is meant for, but it seems to work. See attached definition. Also, credits to Mostapha for figuring out how to get the Grasshopper document using Python a while back :)</span></p> Hi Brian,
What do you mean b…tag:www.grasshopper3d.com,2014-07-18:2985220:Comment:11035352014-07-18T14:38:03.872ZMostapha Sadeghipour Roudsarihttps://www.grasshopper3d.com/profile/MostaphaSadeghipour
<p>Hi Brian,</p>
<p></p>
<p>What do you mean by writing the data to Grasshopper file?</p>
<p></p>
<p>In case you want to change settings, they are get<>set which means you can simply set the value. Give Grasshopper.CentralSettings a try. Something like this:</p>
<p></p>
<p>import Grasshopper.CentralSettings as settings<br></br><br></br>settings.AuthorAddress = "Brooklyn"<br></br>settings.AuthorName = "Brian"…</p>
<p></p>
<p></p>
<p>Hi Brian,</p>
<p></p>
<p>What do you mean by writing the data to Grasshopper file?</p>
<p></p>
<p>In case you want to change settings, they are get<>set which means you can simply set the value. Give Grasshopper.CentralSettings a try. Something like this:</p>
<p></p>
<p>import Grasshopper.CentralSettings as settings<br/><br/>settings.AuthorAddress = "Brooklyn"<br/>settings.AuthorName = "Brian"</p>
<p></p>
<p><a target="_self" href="http://storage.ning.com/topology/rest/1.0/file/get/2768903165?profile=original"><img width="721" class="align-center" src="http://storage.ning.com/topology/rest/1.0/file/get/2768903165?profile=RESIZE_1024x1024" width="721"/></a></p>