AnsweredAssumed Answered

Layers from geobatabase missing using arcpy.mapping.ExportToPNG

Question asked by mrcdecoaticook on Aug 6, 2014
Latest reply on Aug 6, 2014 by mrcdecoaticook



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)


            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