In the example above, the AcDbDictionaryWithDefault object should have been filed out with the AutoCAD 2000 version of its data because it becomes a proxy in all previous versions and no one will be reading its data (except for the data filed out at the AcDbObject level).
To fix this, a mechanism has been introduced where the object can override the filer version and dictate what version it wants to be filed out, or in, with. The following rules apply:
The appropriate rule should be used by the leaf class, as well as all its base classes, to file data in and out. In the example given above, rule 2 applies (the filer is from AutoCAD 2000, while the object is from Release 14), so we file out using the AutoCAD 2000 version. If a new class was introduced in AutoCAD 2000 whose data also changed in AutoCAD 2004, and the operation is to save as Release 14, rule 1 applies and we file out using the AutoCAD 2000 (birth) version.
Two virtual methods of AcDbObject have been introduced to implement class versioning, one for DWG and one for DXF files:
virtual Acad::ErrorStatus getObjectSaveVersion( const AcDbDwgFiler* pFiler, AcDb::AcDbDwgVersion& ver, AcDb::MaintenanceReleaseVersion& maintVer); virtual Acad::ErrorStatus getObjectSaveVersion( const AcDbDxfFiler* pFiler, AcDb::AcDbDwgVersion& ver, AcDb::MaintenanceReleaseVersion& maintVer);
In the filer methods, instead of calling filer->dwgVersion(), call self()‑>getObjectSaveVersion(filer, ...) to let the object indicate which version to use to dump the data out. Similarly, call that method in dwgInFields() and dxfInFields() to find out which version the data is coming back in.
Because not all the objects need to override the filer version, the ones that do specify their intent by setting a bit on the object. This is normally done in the constructor of the class. The bit is used as a quick check to determine if it's necessary to override the filer version. Methods related to this have been added to AcDbObject:
bool hasSaveVersionOverride(); void setHasSaveVersionOverride( bool bSetIt);
There is also a new AcDbObject method to get the birth version of the object:
Acad::ErrorStatus getObjectBirthVersion( AcDb::AcDbDwgVersion& ver, AcDb::MaintenanceReleaseVersion& maintVer);
This method returns the two version numbers stored with the AcRxClass of this object, which are specified while registering the class using the ACRX_DXF_DEFINE_MEMBERS macro.