I use the following code to change the paper size in a layout (in paperspace)
{code}
LayoutManager layMgr = LayoutManager.Current;
Layout layout = tr.GetObject(layMgr.GetLayoutId(layMgr.CurrentLayout), OpenMode.ForWrite) as Layout;
PlotSettingsValidator plSetVal = PlotSettingsValidator.Current;
plSetVal.SetPlotConfigurationName(plSet, deviceName, canonicalMediaName);
plSetVal.SetPlotType(plSet, Autodesk.AutoCAD.DatabaseServices.PlotType.Extents);
plSetVal.SetStdScale(plSet, 1);
plSetVal.SetPlotCentered(plSet, true);
layout.CopyFrom(plSet);
{code}
It works, but the background with paper limits and print area are not at the good location (see picture attached). I tried with Editor.Regen, Editor.UpdateScreen, Database.updateExt, but no success.
To get the correct result, I've to use the PAGESETUP command.
It seems that the limits in paperspace are not updated correctly. Do you know how I can update my screen ?