In C#, I can set data using RhinoDoc.Strings.SetString( StringName, StringValue );
which can then be retrieved in a python script using
strValue = rs.GetDocumentUserText( StringName )
Now my questions are:
is this also possible with other data than strings (now I convert in C# StringValue.ToString() and in Python with float(strValue)
is it possible to pass many of these strings in a structured way? Python suggests to work in sections : value = rs.GetDocumentData(“MySection1”, “MyEntry1”) but how to add these sections in C#? In C# on the other hand, something like UserDictionary seems to exist, but how (if at all) can I address them from Python?
I am currently using UserText, but I am passing quite a lot of values string by string, and casting them in python back from strings to whatever I need in Python.
Is there a more structured way to pass larger amounts of values from C# to Python than string by string? It works for now, but maybe I am missing something to pass all these data is a more structured way…
Thanks for this answer, I am almost where I want now.
Is it also possible to add this dictionary directly to the document and not to an object in the document?
In our C#, we ask the user to define a set of parameters, which is then passed to python to construct the objects. But in C#, there are no geometric objects constructed yet…
Yes, but like filip I am trying to store other types than strings. So an archivable dictionary or something like that attached to the document, rather than to an object would be great. But I could not find a way to do so.