ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcDbPlotSettingsValidator::refreshLists resets margins and papersizes

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
230 Views, 2 Replies

AcDbPlotSettingsValidator::refreshLists resets margins and papersizes

Calling AcDbPlotSettingsValidator::refreshLists in order to initialise the AcDbPlotSettingsValidator object sets the unprintable margins to 0 and sets the physical papersizes to standard values if the selected plotting device is not a .pc3 file but a system device added with printer setup of windows. Using a .pc3 file only helps if the margins are changed with respect to the default values from the plotting device itself.
Manually setting a medium size with the pagesetup command of autocad keeps the real margins en sizes and can even set them back after resetting by AcDbPlotSettingsValidator::refreshLists.
Has anyone experienced this effect and/or knows a remedy.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

 

Hi ,

 

You can by  set
the paper units back to Millimeters after using refreshLists(). Not just
avoiding using refreshLists().

refreshLists() needs to be called at least once before using
functions like getCanonicalMediaNames() or a crash can occur.


 


Cheers,


Varadan



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Calling
AcDbPlotSettingsValidator::refreshLists in order to initialise the
AcDbPlotSettingsValidator object sets the unprintable margins to 0 and sets
the physical papersizes to standard values if the selected plotting device is
not a .pc3 file but a system device added with printer setup of windows. Using
a .pc3 file only helps if the margins are changed with respect to the default
values from the plotting device itself.
Manually setting a medium size
with the pagesetup command of autocad keeps the real margins en sizes and can
even set them back after resetting by AcDbPlotSettingsValidator::refreshLists.

Has anyone experienced this effect and/or knows a
remedy.
Message 3 of 3
Anonymous
in reply to: Anonymous

>You can by set the paper units back to Millimeters after >using
refreshLists(). Not just avoiding using refreshLists().

I tried the following (in the piece marked with <<== ==>>):

{
// Get the global layout manager
AcApLayoutManager *layoutMan = (AcApLayoutManager *)
acdbHostApplicationServices()->layoutManager();
// Get the active layout
const char *activeTab = layoutMan->findActiveTab();
// Get the current layout object
AcDbLayout *layout;
layout = layoutMan->findLayoutNamed(activeTab,Adesk::kTrue);
// Get the autocad object for plotsetting manipulation
AcDbPlotSettingsValidator *validator;
validator = acdbHostApplicationServices()->plotSettingsValidator();
validator->refreshLists(layout);

//<<==
validator->setPlotPaperUnits(layout, AcDbPlotSettings::kMillimeters);
//==>>

layout->close();
}

This did not have any effect on the problem of resetting the unprintable
margins.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost