Skip to main content
replaced http://gis.stackexchange.com/ with https://gis.stackexchange.com/
Source Link

I use this code to export a dataframe to png, and it works.

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
ar = df.extent.height / df.extent.width
arcpy.mapping.ExportToPNG(mxd,r"C:\Users\Kakemphaton\Desktop\out.png",df,1024,1024*ar,96,True)

Code from: Writing world file when exporting TIFF using ArcPy Mapping?Writing world file when exporting TIFF using ArcPy Mapping?

This code exports only the first dataframe and always the first. I can't export others and I have multiple dataframes in my mxd (example_1, example_2, example_3). How could I export example_2 and example_3? I tried to activate it for example_2, but it always exports example_1.

I use this code to export a dataframe to png, and it works.

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
ar = df.extent.height / df.extent.width
arcpy.mapping.ExportToPNG(mxd,r"C:\Users\Kakemphaton\Desktop\out.png",df,1024,1024*ar,96,True)

Code from: Writing world file when exporting TIFF using ArcPy Mapping?

This code exports only the first dataframe and always the first. I can't export others and I have multiple dataframes in my mxd (example_1, example_2, example_3). How could I export example_2 and example_3? I tried to activate it for example_2, but it always exports example_1.

I use this code to export a dataframe to png, and it works.

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
ar = df.extent.height / df.extent.width
arcpy.mapping.ExportToPNG(mxd,r"C:\Users\Kakemphaton\Desktop\out.png",df,1024,1024*ar,96,True)

Code from: Writing world file when exporting TIFF using ArcPy Mapping?

This code exports only the first dataframe and always the first. I can't export others and I have multiple dataframes in my mxd (example_1, example_2, example_3). How could I export example_2 and example_3? I tried to activate it for example_2, but it always exports example_1.

edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Arcmap: export Exporting multiple dataframes as images using ArcPy?

edited tags
Link
Chad Cooper
  • 12.7k
  • 4
  • 47
  • 87
grammar and formatting
Source Link
Chris W
  • 15.8k
  • 2
  • 29
  • 47
Loading
deleted 10 characters in body; edited tags
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
Source Link
Loading