Writing Document User Data (geometry) from GH using GhPython/C#

Hi, is it possible to store geometry data in the rhino document from grasshopper?

I would like to store some GUID and a bunch of dictionaries in the Rhino document and finally some rhinocommon geometry. I’am working in a fairly complex grasshopper definition (it is getting more the “body” of plugin than a grasshopper definition)

My intention is that my grasshopper definition, when launched, asks to the active document if it has the guid’s, dictionaries and geometry data he is looking for, so if they have been saved as custom data in this particular document in a previous session, then my GH definition can start his “bussiness” from there.

Is this possible? all I can find in rhinocommon is storing data in plain string format (wich servers for the guid and dictionary part, but not for the geometry data) Can I somehow fool rhino creating a plugin from grasshopper using GhPython or C# so i can store my geometry data (a bunch of curves) in the Rhino document?


Document user text, yes. But anything else will require a Rhino plug-in that is capable of writing and reading your custom user data.

– Dale

Thanks Dale. and is it possible to “fake” a plugin project from GH? I have created plugins from vs, but the process of creating it was not transparent to me, I mean I used VS templates so i´m not fully aware of each step involved in creating a Rhino plugin. This time, though i´m working from GH… No way to do this, isn´t it?


Ok. I should try this. Apprarently pickle module from python is able to seriealize complex data to strings, so this should work. Thanks @piac and @DavidRutten !