Set "Display printable area" via API

<?xml encoding=”UTF-8″>By Madhukar
Moogala

When you make a new Layout a new Page Setup called Layout1

You see the printable area in Layout. This is a dashed rectangle.

In order to remove that rectangles you set the option via UI:
Go to TOOLS > OPTIONS > DISPLAY > LAYOUT  ELEMENTS > Uncheck “Display printable area”

or to do the same in API

void turnOffPrintableArea()
{
AcApLayoutManager* pApLayoutMgr =
(AcApLayoutManager*)acdbHostApplicationServices()->layoutManager();
if (pApLayoutMgr != NULL) {
pApLayoutMgr->setShowPaperMargins(false);
pApLayoutMgr->updateCurrentPaper();
}
}

Unfortunately, the interface AcApLayoutManager for application-specific routines that manipulate, access AcDbLayout objects and controls layout related GUI attributes is not exposed to NET.

TurnOffDisplayArea


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading