1

I'm fairly novice with code. I am trying to do a simple data driven pages export to .ai using arcpy. I need the resolution down to 150 DPI. Line 4 brings up parsing errSyntax Error: Invalid Syntax. I feel confident it takes place where I want to put in the resolution and the quality of image.

mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
    mxd.dataDrivenPages.currentPageID = pageNum
    arcpy.mapping.ExportToAI(mxd, r"M:\Projects\RAN_GIS_Project_ID\!2016\8852\RAN8851_Cricket_" + str(pageNum) + ".ai",,,,150,"NORMAL")
del mxd
2

try using this:

mxd = arcpy.mapping.MapDocument("CURRENT") 
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1): 
    mxd.dataDrivenPages.currentPageID = pageNum
    arcpy.mapping.ExportToAI(mxd, r"M:\Projects\RAN_GIS_Project_ID!2016\8852\RAN8851_Cricket_" + str(pageNum) + ".ai",resolution=150,image_quality="NORMAL")
    del mxd

I also recommend you shorten the Folder Path and try to avoid characters like !@$%^&* in the path name.

If you don't want to use all the parameters of a arcpy function, you shouldn't leave empty commas ",", but rather enter the parameter value like I did above.

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.