Do 3dm files keep track of which plugins and their versions where used when saving a 3dm file? This is separate from using a document or user data major and minor versioning, but to do with the actual plugin version i.e. 0.0.0.1. At the moment we’re saving the version using archive.WriteString() but wanted to know if this information was saved somewhere in the 3dm (regardless of user data or document data that is being written?).
We’re probably not going about this in the right way but we have an expected layer structure that has changed across plugin versions. We’ve started writing the plugin version to the 3dm so we can do something like “If less than this version, map this old layer structure to this new layer structure” which works well enough, however wanted to know if 3dm files have knowledge of what plugins were available/loaded when they were saved?
Apologies if this has already been answered but couldn’t find anything in amongst all the posts to do with yak, assembly and food4rhino versioning, nor anything in the RhinoCommon docs.
Thanks @dale – had a quick look at the C++ docs; there’s not a way to access the Audit3dmFile information via that route? Can only see bool CRhinoDoc::Audit…
No, there is no functional equivalent to the Audit3dmFile in any of our APIs.
That said, you shouldn’t need to know what version of your plug-in was loaded when a .3dm file was saved. What’s important is the the version of the user data that you wrote.
That’s fair – we’ve probably shot ourselves in the foot by not using user data, and now don’t have a good way to target a version.
This particular problem is because we’re using layers to select geometry i.e. do something to all the geometry on the proxy layer. We’ve since change this so that the proxy layer is now nested under a parent layer, i.e. design::proxy. In our latest plugin if we run a command that’s looking for design::proxy, but is a older file that only has the non-nested proxy layer, it fails. To make it more seamless for the users we’ve added a check when the file loads to see if it has a saved plugin version (as we now write the plugin version into the file), if there’s no plugin version then it assumes it has the older layer structure and updates it to match the new, nested layer structure – which is working fine, we just have a few other instances like this where we don’t have user data to control what should happen, and we’ll likely change the layer structure again.
Anyway, I was just curious if we could read the plugin version straight from the file mainly so we could have better “hindsight” control for files we didn’t consider this issue for, rather than putting a blanket “before this version do this”.