Unable to access UserDictionary data in Headless conditions

Hello,

I have a plugin that creates custom objects from Rhino objects and I serialize them inside ArchivableDictionaries in the Rhino object geometries. When I deserialized in headed Rhino I can retrieve the ArchivableDictionaries easily.

However I’m trying to create a unit test suite where I define fixtures by registering my plugin objects in a Rhino file, try to open this file in a Headless state and try to deserialize my objects by accessing the ArchiveableDictionaries. But when I try to access my obj.Geometry.ArchiveableDictionary the result is always null. I tried to get the ObjectTable both by using RhinoDoc.OpenHeadless() and Rhino3dm.Read(), no success with any of them.

I saw some discussion here saying that this is something that is on McNell plan to support, do you have any updates on this?

1 Like

Hi @Marcio_Souza,

We do have plans to support this, but not in Rhino 7.

If you need this capability today, then you should consider writing your data in one of the two ways described in each of the threads you’ve referenced.

– Dale

Hey @dale, is this possible if using C++?

Hi @csykes,

No, sorry. The ArchiveableDictionary class in V7 is pure .NET.

We are working on moving the dictionary to C++ and into openNURBS, which will make the data accessible from outside of Rhino. But this won’t happen in the Rhino 7 lifetime.

– Dale

1 Like

And what if I use Rhino.Inside in my xUnit project?

Hi @Marcio_Souza,

If you use Rhino.Inside, you are using Rhino and, thus, will have full access to whatever you need.

– Dale