Document User Data from Python?

Is it possible to read/write document user data from a python script? After reading the RhinoCommon example for plugins it seems that one may have to use a true plugin to do this, given that you have to derive from the plugin class and it seems that Rhino controls when the data is read/write by calling the overridden read/write methods. I’m just wondering if there’s a way to force read/write this data from a python script without rhino having to mediate (similar to how the document notes work)

For true document data, yes, you will need to create a plug-in.

But, the Rhino document can store user strings just like any object can.

doc.Strings.SetString(...

Does this help?

Possibly. I’m trying to add some persistence to a design tool. I just need the script to be able to reconstruct hierarchies of objects. Some of the data is GUIDs in lists which would be pretty easily to textualize and then parse later, but some of it is RhinoCommon classes so…I don’t think everything can be easily serialized. Maybe I can redesign my classes to be better suited to this.