Friday, 2 February 2018

arcgis 10.2 - Converting mxd to earlier version using ArcPy?


I am running arcmap 10.2.2 but need to open an mxd saved using 10.3. I do not have access to 10.3. I have an arcpy tool which will do the conversion but it is not working from within 10.2.2.


Does anyone know if it is possible to do this from within 10.2.2. I get an error message saying I do not have write access to the file.


The script is as follows:


import arcpy, sys, os, string 

mxdList = string.split(arcpy.GetParameterAsText(0), ";")
outloc = arcpy.GetParameterAsText(1)
version = arcpy.GetParameterAsText(2)


suffix = "_"+ version.replace(".", "")

for item in mxdList:
item = item.strip('\'')
mxd = arcpy.mapping.MapDocument(item)
base = os.path.basename(item)
base = os.path.splitext(base)[0] + suffix + os.path.splitext(base)[1]
mxd.saveACopy(outloc + os.sep + base, version)
arcpy.AddMessage(os.path.basename(item) + " has been converted")



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...