When working with large .dwg files, sometimes a full save can be slow. Drawings SDK has an incremental file saving feature for .dwg files that saves only modified data, which is faster than a full save for large files that don't contain a lot of modifications.
Drawings SDK provides the following method to perform the incremental file save:
void OdDbDatabase::save(const OdString& filename, bool saveThumbnailImage = false);
The first parameter is a target file name. The name should be equal to another one which may be obtained from the database you want to save. If the name does not match, the method will perform a full save. The second parameter controls the saving of a thumbnail image to the file.
A file will be saved incrementally under the following conditions only:
If at least one of the conditions is violated, the method will perform a full save. Also, the method behavior depends on the value of the ISAVEPERCENT system variable. The ISAVEPERCENT value is a percentage of wasted(unused) space tolerated in the file. If ISAVEPERCENT is equal to 0, the method will perform a full save. Otherwise, it works as follows:
It is recommended to use the OdDbDatabase::save(...) method when performing a file save operation using the SAVE command. But for "SAVE AS", you should use the OdDbDatabase::writeFile(...) method. You can separate corresponding calls when implementing your own application.
See also the OdaMfcApp example application for how to use incremental file saving in Drawing\Examples\win\OdaMfcApp\OdaMfcAppDoc.cpp
Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.
|