AnsweredAssumed Answered

AssertionError: Invalid MXD filename...why?

Question asked by rgthurau on May 14, 2012
Latest reply on Oct 22, 2012 by rgthurau
Hi,
I have a simple script for batch exporting .mxds to .PNG:

import arcpy, os ws = arcpy.env.workspace = r"X:\DATA\07_Reporting\MapDocuments\UTC_Factsheet_ANCs" outDir = r"C:\_Rich\Project_Temp\dc\MapTest"  mapList = arcpy.ListFiles("*.mxd") for m in mapList:     print m     mxd = arcpy.mapping.MapDocument(ws + m)     #arcpy.mapping.MapDocument(mxd)     arcpy.mapping.ExportToPNG(mxd, outDir + '\\' + str(m))     del mxd


I've used this code several times before. I don't think I've modified it at all, except for the workspace and outdirectory.

Today, I am getting the following error:
Traceback (most recent call last):
  File "X:\DATA\INRMP_JPG\Tools\Scripts\export_mxd_to_PNG_Smoky.py", line 10, in <module>
    mxd = arcpy.mapping.MapDocument(m)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\mixins.py", line 443, in __init__
    assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(89004, "Invalid MXD filename")
AssertionError: Invalid MXD filename.

Note: Neither my filenames or mxd names have any spaces in them (although that hopefully would be okay).

I need this bad because i have many maps to convert.
Help on this would be awesome.

Running Arcgis 10.0 sp4
win7 64bit

Thanks
Rich

Outcomes