TheSwamp
Code Red => .NET => Topic started 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?
-
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
-
The code posted was from : http://forums.autodesk.com/t5/net/setting-media-format-and-orientation-for-plot/m-p/1924702#M6603
-
Thanks. I ended up using this to get the actual printable area:
PlotConfigManager.CurrentConfig.GetMediaBounds(_thisCanMedia).LowerLeftPrintableArea
PlotConfigManager.CurrentConfig.GetMediaBounds(_thisCanMedia).UpperRightPrintableArea