I have a python script, which I like to remember some data between calls to that script, but also between sessions.
Well, to remember data between calls there is an easy solution as I could use the scriptcontext.sticky dictionary as in this sample. This is a standard python dictionary and as such very versatile to use. However, this is not stored between sessions
To store values between sessions the only possibility (besides writing to a separate file) is to use the DocumentUserData with rhinoscriptsyntax or RhinoCommon. This has two drawbacks. I am limited to storing string variables in only one layer of nesting (section, entry, value) and I have to write to the DocumentUserData all the time as there is no proceedure that automatically stores to the DocumentUserData if Rhino is being closed.
Apparently, the best way to achieve an automated storage between sessions would be via a Plug-In and the overridden readDocument() and writeDocument() Methods. However, as I understand, this will currently not work with a Rhino Plug-In.
Are there any alternative ways to store data between sessions I am not aware of?
Or is there a possibility to mix C# and Python for a Plug-In, e.g. use C# as a wrapper for an otherwise Python based Plug-In? If so, are there any tutorials or samples?
Any help is very much appreciated!