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

Setting Media Format and Orientation for plot

Message 1 of 3
557 Views, 2 Replies

Setting Media Format and Orientation for plot

I'm trying to automatically plot generated documents in ACAD Map using .NET.
I plot to DWF and PDF files.
Plotting works just fine, but now I have two problems.
First: I want to select a certain media format. I need to print to ISO A3.
I try to set this format using:

PlotSettings settings = new PlotSettings(true);
PlotSettingsValidator settingsValidator = PlotSettingsValidator.Current;
settingsValidator.SetClosestMediaName(settings, 420.0, 297.0, PlotPaperUnit.Millimeters, false);

SetClosestMediaName throws an Exception that complains about "eInvalidInput".

I tried to get a list of supported media names using
StringCollection media = settingsValidator.GetCanonicalMediaNameList(settings);
To my surprise I discovered that the resulting list doesn't contain ISO A3.
It contains A4 and A5 though.
When I open the plot-dialog manually I get a much longer list of supported media types - where do they come from?
How can I select those?
Best solution: How can I set the format to fit on 420x297 mm? I don't care about the name the required format has to ACAD 😉

Now to my second problem:
Rotating the page.
When I plot the drawing, the resulting DWF and PDF files differ.
The DWF is plotted on a landscape "paper", although the drawing would be portrait.
Although the plotsettings have set to fit the drawing on the paper, the top and bottom borders of my drawing are missing on the landscape DWF.
When I plot to PDF things get even worse.
The pdf is in portrait, the drawing is rotated by 90 degrees, so it doesn't fit on paper either.

Can anyone help me with this?
I've tried to setthe rotation using
settingsValidator.SetPlotRotation(settings, PlotRotation.Degrees000); and other rotation-values, but it didn't work as expected.
I need this to be done quickly and I don't know what I can do about it anymore.
Any help is really appreciated.

Best Regards
Christian Nitschkowski
Message 2 of 3
in reply to: chrnit

Same problem. SetClosestMediaName throws an exception. Do you have found a solution ? Edited by: mdelanno on Oct 20, 2009 10:18 AM
Message 3 of 3
in reply to: chrnit

I ended using the plot config to find my paper size :

PlotConfig plotCfg = PlotConfigManager.CurrentConfig;
foreach (string canonicalMediaName in plotCfg.CanonicalMediaNames)
MediaBounds mediaBounds = plotCfg.GetMediaBounds(canonicalMediaName);
// Use mediaBounds.PageSize.X and mediaBounds.PageSize.Y to find the paper size

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

Post to forums  

Autodesk DevCon in Munich May 28-29th

Autodesk Design & Make Report