0

I want to export maps that I have created on ArcMap 10.1 with this Python code:

mxd = arcpy.mapping.MapDocument("CURRENT") 
for i in range(1, mxd.dataDrivenPages.pageCount + 1): 
    mxd.dataDrivenPages.currentPageID = i 
    row = mxd.dataDrivenPages.pageRow
    print row.getValue("no lot")
    arcpy.mapping.ExportToJPEG(mxd, r"p:\Isa\2018_CS_Bilans_Hydriques_COPIE\CS images cadastre 1\_" + str(row.getValue("no lot")) + ".jpg") 
del mxd 

The map is saved as JPEG, in a specific folder. I've tried this code before and it worked. I just changed the folder's name in the code and tried to export other maps from the same project and it won't work: it just produces an error code:

Runtime error 
Traceback (most recent call last): 
  File "<string>", line 5, in <module>
  File "C:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\arcobjects\arcobjects.py", line 1011, in getValue 
    return convertArcObjectToPythonObject(self._arc_object.GetVa1ue(*gp_fixargs(args))) 
RuntimeError: ERROR 999999: Error executing function. 

How can I solve this?

0

Not really an answer...I had a similar experience about a year ago. The export process, for some unknown reason, started throwing some error that I could never figure out. My first work around, to switch to a different export format worked for a short while until the same mysterious error was thrown. The frustration of it all forced me to use ArcGIS Pro and I never saw the error again. Perhaps that is an option for you?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.