Community
private void
BeginPageEventHandler(object obj, Autodesk.AutoCAD.PlottingServices.BeginPageEventArgs e)
{
PlotInfo plotInfo = e.PlotInfo;
Database DB = acadApp.DocumentManager.MdiActiveDocument.Database;
Autodesk.AutoCAD.DatabaseServices.TransactionManager TM = DB.TransactionManager;
Transaction tr= TM.StartTransaction();
Layout layout = tr.GetObject(plotInfo.Layout, OpenMode.ForRead) as Layout;
Point2d plotPaperSize = layout.PlotPaperSize;
}
<\code>
HTH
Jai
@Anonymous wrote:
Oops! The EndPlot event fires at the end of a plot preview as well as the End of a plot. So I will need to handle CommandEnded instead and check for the plot command being ended. Thanks for the Initialize and Terminate methods of IExtensionApplication. These will come in very handy in future. I could add the CommandEnded event handler ther too. But then the only drawing being watched would be the drawing active when the program was loaded. How do I add a Command event handler that will be applied to any drawing?
Thanks for your patience...
Kevin.
For people like me, who find and read this thread (although it is already old):
A (better) solution to the plot preview also fires plotting events problem can be found here: