Author Topic: Get the plot media height and width dimensions  (Read 2359 times)

0 Members and 1 Guest are viewing this topic.

AKS

  • Guest
Get the plot media height and width dimensions
« on: September 16, 2014, 06:45:36 PM »
How does one get the plot media height and width dimensions given a CanonicalMediaName without resorting to trying to parse out the dimensions from the CanonicalMediaName? If this can be done then great but going one further can one obtain the actual plot boundary dimensions instead of the nominal dimensions?

EZCAD

  • Guest
Re: Get the plot media height and width dimensions
« Reply #1 on: October 10, 2014, 02:44:46 AM »
Hi, here is an extract of a post which appears on Autodesk's .NET forum, it should give you some ideas:

{code}
PlotConfigManager.SetCurrentConfig(device);
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
}
{code

Steve

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

AKS

  • Guest
Re: Get the plot media height and width dimensions
« Reply #3 on: October 10, 2014, 09:48:45 AM »
Thanks. I ended up using this to get the actual printable area:

PlotConfigManager.CurrentConfig.GetMediaBounds(_thisCanMedia).LowerLeftPrintableArea
PlotConfigManager.CurrentConfig.GetMediaBounds(_thisCanMedia).UpperRightPrintableArea