Hi again, I coworker of mine found this:
"
File format
New file format "AutoCAD 2013 Drawing" is used.
AutoCAD 2013 introduces a new file format that includes changes to the thumbnail preview file format, as well as new controls for graphics caching.
Thumbnail previews in the new AutoCAD 2013 DWG file format are now stored as PNG images, providing higher-quality thumbnail previews in a smaller file size. Image resolution is still controlled by the THUMBSIZE system variable. However, the maximum valid value has increased from 2 to 8. If you do not wish to include thumbnail previews in the drawing you can still use the RASTERPREVIEW system variable (or the new THUMBSAVE) to disable them. Note that only 3D drawings make use of a larger thumbnail. The UPDDATETHUMBSNOW and UPDATETHUMBNAIL system variables are no longer needed and have been removed from AutoCAD 2013.
When you save a drawing containing 3D Solids in the new AutoCAD 2013 file format, a graphics cache file is automatically stored in a folder named “GraphicsCache” under your user app data folder. Two new system variables, CACHEMAXTOTALSIZE and CACHEMAXFILES, enable you manage the cache files."
"
I am not sure how to use this information about the system variables. The simple thing i was thinking was to write a function that opens all dwg-files and closes them to read them to cache. Is this the best way?
I am having som trouble doing this. In the code under the document I open does not seem to be put as active document and if I set it as active document my function stops.
public static void OpenAllFiles(string[] files)
{
foreach (string file in files)
{
bool opened = OpenFile(file);
bool closed = CloseFile();
}
}
public static bool CloseFile()
{
DocumentCollection acDocMgr = AcadApp.DocumentManager;
try
{
acDocMgr.MdiActiveDocument.CloseAndDiscard();
return true;
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
return false;
}
}
public static bool OpenFile(string strFileName)
{
DocumentCollection acDocMgr = AcadApp.DocumentManager;
if ((File.Exists(strFileName)))
{
Document newDoc = acDocMgr.Open(strFileName, false);
return true;
}
else
{
return false;
}
}