Here is what I do in my program.
I create a new AcDbPlotSettings variable and then I copy the settings from the current layout (Model or PaperSpace) in the variable. From that point I use my AcDbPlotSettings variable to make any adjustments to the plot settings and plot the drawing.
Example of copying a layout:
AcApLayoutManager *pLM = (AcApLayoutManager *)acdbHostApplicationServices()->layoutManager();
AcDbObjectId aoBTRId = pLM->getActiveLayoutBTRId();
AcDbBlockTableRecord *pBTR;
es = acdbOpenObject(pBTR, aoBTRId, AcDb::kForRead);
if (es != Acad::eOk)
{
return 1;
}
AcDbObjectId aoLayoutId = pBTR->getLayoutId();
pBTR->close();
if (aoLayoutId.isNull())
{
return 1;
}
AcDbLayout *pLayout;
es = acdbOpenObject(pLayout, aoLayoutId, AcDb::kForRead);
if (es != Acad::eOk)
{
return 1;
}
AcDbPlotSettings *pPS = new AcDbPlotSettings(pLayout->modelType() == Adesk::kTrue);
if (pPS == NULL)
{
pLayout->close();
return 1;
}
es = pPS->copyFrom(pLayout);
pLayout->close();
From this point on I used the AcDbPlotSettingsValidator class to adjust any settings the the AcDbPlotSettings variable (pPS)
AcDbPlotSettingsValidator *pPSV = (AcDbPlotSettingsValidator *)acdbHostApplicationServices()->plotSettingsValidator();
Once I am finished with the AcDbPlottingSettings variable (pPS) I simply delete it.
delete pPS;
This allows me to create temporary layout from an existing layout that I can modify and use to plot the drawing.
Note: pPS->modelType() returns true if the layout is a Model layout vs. a Paperspace layout.