eWasOpenForRead using PlotToFile..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys, I've a problem. I need to print each layout of my drawing using PlotToFile method of the ActiveDocument.Plot obect, but randomly AutoCAD crash (internal error message popup) with eWasOpenForRead code. This is my code:
AcadDocument acDoc = this.Application.ActiveDocument;
AcadPlot aPlot = acDoc.Plot;
aPlot.QuietErrorMode = false;
this.SetVariable(acDoc, "BACKGROUNDPLOT", 0);
string PlotPc3 = "AUTOMATICO-BN.pc3";
bPrintOk = true;
foreach (AcadLayout layout in acDoc.Layouts)
{
this.WaitApplicationQuiescent();
string sFileLayout = sName + "_" + layout.Name + ".plt";
string[] ls = new string[] {layout.Name};
aPlot.SetLayoutsToPlot(ls);
if (aPlot.PlotToFile(sFileLayout, PlotPc3) &&
System.IO.File.Exists(sFileLayout))
{
//No errors!
}
else
{
//Error!
bPrintOk = false; break;
}
aPlot.SetLayoutsToPlot(new string[0]);
ls = null; GC.Collect();
this.WaitApplicationQuiescent();
}
Any ideas?
Thank you very much
Enrico