There's something different about "GenerateUsageData". I see the progress bar flash by in the bottom right corner. I don't understand why I see anything in the editor.
I was working on a dwg sample but I can't replicate it. I found the file using debug. The handles belong to 4 zero length plines. When I strip everything else out of the file I don't get the messages anymore. Unfortunately I can't post it here. Below is all the code required to generate the messages. I'll resurrect this post in the future if I get any more information. Thx
[CommandMethod("scanfiles")]
static public void scanfiles()
{
string msg = "scanfiles";
Document doc = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
List<string> dwgfiles = new List<string>();
dwgfiles.Add("c:\\temp\\bad_plines.dwg");
dwgfiles.Add("c:\\temp\\bad_plines_ii.dwg");
foreach (string d in dwgfiles)
{
Database scandb = new Database(false, true);
try
{
scandb.ReadDwgFile(d, System.IO.FileShare.Read, true, null);
msg += "\nfile open " + d;
}
catch
{
msg += "\nfile not open " + d;
continue;
}
using (Transaction tr = scandb.TransactionManager.StartTransaction())
{
// layers
LayerTable lt = (LayerTable)tr.GetObject(scandb.LayerTableId, OpenMode.ForRead);
lt.GenerateUsageData();
tr.Commit();
}//
}// foreach
ed.WriteMessage(msg);
}// scanfiles - acad command