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

Plot Paper Units Problem

8 REPLIES 8
Reply
Message 1 of 9
bakerrl2
530 Views, 8 Replies

Plot Paper Units Problem

I am experiencing a problem with the PlotPaperUnits in the AcDbPlotSettings class.  I have a function which allocates a AcDbPlotSettings class and then copies the values from the current layout into the variable using the copyFrom function.

 

Once I have created and initialized my class I start modifying the settings using a AcDbPlotSettingsValidator variable.  Initially the PlotPaperUnits are set to inches.  Later when I set the PlotCfgName in order to use a specific plotter, the PlotPaperUnits change to millimeters.

 

What makes this situation unusal is that the PlotPaperUnits only change from inches to millmeters when I use the function to plot certain drawing files.  Most of the drawings plotted using the function do not cause the units to change.  When they do change it produces a plot where the drawing is the size of a postage stamp on a D size sheet.

 

When I look at the plot settings in the current layout using the Page Setup Manager in AutoCAD it indicates the plot units are inches.  Even if I manually switch the printer, the plot units remain inches.  I am trying to figure out if there is some setting in the Layout or drawing that would cause this problem.  It is almost like the Plot Dialog is displaying inch units when it is really millimeters.

 

8 REPLIES 8
Message 2 of 9
Balaji_Ram
in reply to: bakerrl2

Hello,

 

How about setting the PlotCfgName first and then the PlotPaperUnits when using the PlotSettingsValidator ?

 

Does the plot units change if you manually change to a paper size that uses different units in AutoCAD ?

 

Also, can you please share a non-confidential sample drawing to reproduce the behavior ?

 

Regards,

Balaji

 

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 9
m_latz
in reply to: bakerrl2

Do you use the function refreshLists() somewhere in your code ?

 

In the past there was a problem with switching units after the use of this function.

 

regards

 

Markus

Message 4 of 9
nick83
in reply to: bakerrl2

AcDbPlotSettingsValidator::setPlotPaperUnits(AcDbPlotSettings*,AcDbPlotSettings:: PlotPaperUnits /* for example AcDbPlotSettings::kMillimeters*/);
AcDbPlotSettingsValidator::setPlotPaperUnits(AcDbLayout*,AcDbPlotSettings:: PlotPaperUnits /* for example AcDbPlotSettings::kMillimeters*/);

this will help to set units as you want for layout and printer

Message 5 of 9
bakerrl2
in reply to: Balaji_Ram

I could set the PlotPaperUnits after setting the PlotCfgName but I am trying to use whatever units were set in the current layout.  As I mentioned I used the AcDbPlotSettings::copyFrom function to copy the settings from the current layout.  After I copy the settings the PlotPaperUnits are Inches.  The next step is to set the PlotCfgName.  If I check the settings after that, the units have been changed to millimeters.  At this point I am trying to figure out why this is happening because it only happens with certain drawings.

Message 6 of 9
bakerrl2
in reply to: m_latz

The only time my code calls refreshLists is when it fails to set the PlotCfgName.  When that happens it refreshes the list and tries setting the PlotCfgName again.

 

When I debugged the program it succesfully set the PlotCfgName so it did not call the refreshLists function.

Message 7 of 9
m_latz
in reply to: bakerrl2

It seems the same problem I had a few years ago. I remember, there was an article in the ADN network, and after following their recommendations it worked. I have to check my code on my backup.

 

Give me a few hours ...

Message 8 of 9
bakerrl2
in reply to: nick83

I am not trying to set the PlotPaperUnits.  I am trying to use the PlotPlayUnits that were copied from the current layout.  Initially the PlotPaperUnits match the units in the current layout; however, once I set the PlotCfgName they have been changed behind the scenes to millimeters.  This only happens with certain drawings so I am trying to figure out what is causing the units to change.

Message 9 of 9
m_latz
in reply to: bakerrl2

I've checked my code and I read as 1st action the current plotpaper units and check the units again shortly before I call the plot engine and correct if necessary.

 

I hope this helps you.

 

regards

 

Markus

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

Post to forums  

Autodesk Design & Make Report

”Boost