I am using the Rhino3dm NuGet library and trying to calculate and store a Transform object into UserDictionary of a layer so that I can retrieve it later. The ArchivableDictionary class which has a Set(string key, Transform xform) which looks to be exactly what I want but I don’t see a corresponding way to get that value back as a Transform object.
I saw the note from Steve B in the thread I linked above which implied that the UserDictionary should be supported in .NET but I’m guessing since I am in .NET 6.0 that the build of Rhino3dm doesn’t have these features due to cross-platform compatibilty. Correct me if I’m wrong.
In any case what I am seeing is that in this code:
In the mean time, you might need to consider using another form of meta data. Of course, user strings work in both RhinoCommon and Rhino3dm .NET. But for objects such transforms, this might not be all that elegant.
Document user data and Rhino object user data can be read with Rhino3dm .NET using File3dmPlugInDataTable.TryRead and File3dmObject.TryReadUserData, respectively. This requires that your share your user data code between your Rhino plug-in and your external application. I don’t believe we provide any example of this. But I can code up something you need help.
Well darn, that was not the answer I was hoping for. I may have to try converting Transform objects to strings and back and using the user strings. Like you said, not elegant. Down the road I foresee wanting to write other types of data so getting access to the ArchivableDictionary will be a big help.
An example of how to use document user data and rhino object user data with Rhino3dm .NET would be very welcome.