C3D-0681 · 261009 plot 11X17 DEMO to PDF (read-only) [C3D-PLOT1009] done
Plots 11X17 DEMO to PDF beside the drawing (plot-layout-pdf recipe).
C# payload
string pdf=System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Db.Filename),"261009 - 510 Covington Cove - 11X17 DEMO.pdf");
var ld=(DBDictionary)Tx.GetObject(Db.LayoutDictionaryId,OpenMode.ForRead);
var lo=(Layout)Tx.GetObject(ld.GetAt("11X17 DEMO"),OpenMode.ForRead);
Log("layout 11X17 device='"+lo.PlotConfigurationName+"' media='"+lo.CanonicalMediaName+"' style='"+lo.CurrentStyleSheet+"'");
var lm=Autodesk.AutoCAD.DatabaseServices.LayoutManager.Current; string prev=lm.CurrentLayout;
object bg=Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("BACKGROUNDPLOT");
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("BACKGROUNDPLOT",(short)0);
try{
if(prev!="11X17 DEMO") lm.CurrentLayout="11X17 DEMO";
var ps=new PlotSettings(false); ps.CopyFrom(lo);
var psv=PlotSettingsValidator.Current;
psv.SetPlotConfigurationName(ps,"DWG To PDF.pc3",lo.CanonicalMediaName);
var pi=new Autodesk.AutoCAD.PlottingServices.PlotInfo(); pi.Layout=lo.ObjectId; pi.OverrideSettings=ps;
var piv=new Autodesk.AutoCAD.PlottingServices.PlotInfoValidator(); piv.MediaMatchingPolicy=Autodesk.AutoCAD.PlottingServices.MatchingPolicy.MatchEnabled; piv.Validate(pi);
if(Autodesk.AutoCAD.PlottingServices.PlotFactory.ProcessPlotState!=Autodesk.AutoCAD.PlottingServices.ProcessPlotState.NotPlotting){ Log("BUSY - another plot is running"); }
else using(var pe=Autodesk.AutoCAD.PlottingServices.PlotFactory.CreatePublishEngine()){
pe.BeginPlot(null,null);
pe.BeginDocument(pi,Db.Filename,null,1,true,pdf);
var ppi=new Autodesk.AutoCAD.PlottingServices.PlotPageInfo();
pe.BeginPage(ppi,pi,true,null); pe.BeginGenerateGraphics(null); pe.EndGenerateGraphics(null); pe.EndPage(null);
pe.EndDocument(null); pe.EndPlot(null);
}
} finally {
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("BACKGROUNDPLOT",bg);
if(lm.CurrentLayout!=prev) lm.CurrentLayout=prev;
}
var fi=new System.IO.FileInfo(pdf); Log("pdf="+pdf+" exists="+fi.Exists+(fi.Exists?" bytes="+fi.Length+" time="+fi.LastWriteTime:""));
Result
Log
layout 11X17 device='AutoCAD PDF (General Documentation).pc3' media='ANSI_full_bleed_B_(11.00_x_17.00_Inches)' style='monochrome.ctb' pdf=C:\Users\sanja\OneDrive\_SurveyDisco\261009 - 510 Covington Cove, Byron, GA 31008, USA\261009 - 510 Covington Cove - 11X17 DEMO.pdf exists=True bytes=347385 time=11/3/2026 1:08:02 AM
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.