6

I need my script to access the Page Orientation property of the current MXD, and switch it from portrait to landscape (or back).

I've looked through the ArcGIS 10 arcpy and arcpy.mapping documentation, and haven't had any luck.

Does anyone know how to do this?

  • This becomes easy in ArcGIS Pro where, since at least ArcGIS Pro 1.4.1 (and probably earlier), the Layout class has Read and Write Properties for pageHeight and pageWidth to set a layout's page height and based on the current pageUnits. – PolyGeo May 18 '17 at 5:15
6

Sadly the answer is no. sorry

Even from ESRI Staff:

"There are currently no properties to read/change the page size using arcpy.mapping. As a workaround, you could create MXDs for each page size and oreintation you needed. The closest example I can think of is the "Creating a map book with facing pages" help topic. It doesnt use different pages sizes, however, it does use two MXDs, one for right facing pages, one for left facing pages. In your case, you may have one MXD for letter size, and one MXD for legal size, as an example."

http://forums.arcgis.com/threads/10361-change-Page-and-Print-Setup-from-ArcPy?p=32342#post32342

Possible Workaround is:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s90000002p000000.htm

5

Can't do it yet in 10.0 from arcpy.mapping, going to have to use .Net or comtypes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.