Arcpy.mapping Get the extent of the map elements.

Discussion created by gabrisch on Oct 13, 2015
Latest reply on Jan 4, 2016 by gabrisch

I have a Python script that will automatically;  export the current MXD to a JPG in the same directory as the MXD, name the JPG the same as the MXD with a date added on, store the path to the MXD in a CSV file (including the requester's name), and optionally open the JPG and/or the file location in with Windows Explorer.


I would like to improve the script by ensuring that the output JPG is clipped to all graphic elements.  Exporting the JPG clipped to the graphic extent is an option if you export via the File-Export Map menu but there is not a handy way of getting those values in Arcpy.mapping.


I know I could iterate through all the map elements and identify the xy min/max values, and I am guessing I could clip the output graphic using the Python Image Library.

Does anyone have a arcpy.mapping solution to limiting the export JPG to the same extent as the map elements and not the same size as the page size?