Tag Info

New answers tagged


The function below is based on Ryan's idea, but is a little more direct. ArcGIS map documents are actually OLE documents, which can be parsed with the oletools module (available on pypi: https://pypi.python.org/pypi/oletools). The function opens the file and reads the version string. Tested with 9.0, 9.3, 10.1 and 10.3, but should work with anything (not ...


Answer to your original question: There is no "CURRENT" MXD when running outside of ArcMap. Use mxd = arcpy.mapping.MapDocument(r'C:\full\path\to.mxd') instead. Answer to your edited question: You can't create a Layer object from a MapDocument object (i.e. layer = arcpy.mapping.Layer(mxd)). Do something like this instead: for fc in fcs: layer = ...

Top 50 recent answers are included