HOW TO
After changing the page size the objects in the layout doesn't match the extent of the page. This script below will automatically make the object in the layout match the page size.
Code:
thelay = av.getactivedoc
thelaydisp = thelay.getdisplay
thelaydisp.setunits(#units_linear_inches)
theglist = thelay.getgraphics
theglist.selectall
theglist.groupselected
thetest = thelaydisp.returnmarginextent
thetesta = thetest.clone.scale(0.985)
theglist.setselectedextent(thetesta)
theglist.ungroupselected
thesca = theglist.Findbyclass(scalebarframe)
thesca.setintervals(2)
thesca.setdivisions(1)
thelay.invalidate
Get help from ArcGIS experts
Download the Esri Support App