TheSwamp

Code Red => .NET => Topic started by: AKS on September 16, 2014, 06:45:36 PM

Title: Get the plot media height and width dimensions
Post by: AKS 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?
Title: Re: Get the plot media height and width dimensions
Post by: EZCAD 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
Title: Re: Get the plot media height and width dimensions
Post by: Kerry on October 10, 2014, 03:21:59 AM
The code posted was from : http://forums.autodesk.com/t5/net/setting-media-format-and-orientation-for-plot/m-p/1924702#M6603
Title: Re: Get the plot media height and width dimensions
Post by: AKS 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