Hi,
I have several MXD projects that I export with arcpy.mapping.ExportToPNG. In these MXDs, there are some layers wich are shapefiles, and other layers that are stored in a personal geodatabase.
When I use python for exporting, only the layers that are shapefiles appear on the PNG file.
When I execute my script directly in ArcCatalalog, I don't have this problem. It's only when I execute the script by double-clicking on the .py file.
Any idea of what's wrong?
import arcpy, os
folderPath = r"D:\Projet\MRC\Incendie\2014-03_Intervention\Temps d'invervention"
for filename in os.listdir(folderPath):
fullpath = os.path.join(folderPath, filename)
if os.path.isfile(fullpath):
basename, extension = os.path.splitext(fullpath)
if extension.lower() == ".mxd":
mxd = arcpy.mapping.MapDocument(fullpath)
arcpy.mapping.ExportToPNG(mxd,
basename + '.png',
data_frame = "PAGE_LAYOUT",
df_export_width = 6800,
df_export_height = 4400,
resolution = 400,
world_file = False,
color_mode = "24-BIT_TRUE_COLOR",
background_color = "255, 255, 255",
interlaced = False)
del mxd
Solved! Go to Solution.
I found the solution myself.
The problem is that Personnal geodatabases are no longer supported by 64-bits geoprocessing.
To workaround, I had to change my system PATH variable from
C:\Python27\ArcGISx6410.2 to C:\Python27\ArcGIS10.2
(for using along with batch script) as well as my file association (for double-clicking on the .py file).
I found the solution myself.
The problem is that Personnal geodatabases are no longer supported by 64-bits geoprocessing.
To workaround, I had to change my system PATH variable from
C:\Python27\ArcGISx6410.2 to C:\Python27\ArcGIS10.2
(for using along with batch script) as well as my file association (for double-clicking on the .py file).