<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcPy, Determine what version an MXD is? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359250#M12417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;No, not possible in Python in ArcGIS 10 to tell what release a mapdocument is currently saved as (I'm told possibly at 10.1)&lt;BR /&gt;-Dave&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Assuming you're still out there do you know if this got added to 10.1?&amp;nbsp; I really need that able in a script I'm writing that strips out broken map service datasources.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Oct 2013 15:32:57 GMT</pubDate>
    <dc:creator>RandyKreuziger</dc:creator>
    <dc:date>2013-10-11T15:32:57Z</dc:date>
    <item>
      <title>ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359245#M12412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an ArcPy python script that replaces data sources.&amp;nbsp; Right now I'm saving out the MXDs as 9.3 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but ideally I want to save the repaired version out in the same version of ArcGIS that the original is in.&amp;nbsp; Is there a way to do this?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I don't specify the version my 9.3 mxds are saved out in version 10.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 21:19:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359245#M12412</guid>
      <dc:creator>RandyKreuziger</dc:creator>
      <dc:date>2010-08-02T21:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359246#M12413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi kreuzrsk,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, you can save out a map document to a different version using the saveACopy method on the MapDocument class.&amp;nbsp; The last argument is a version keyword.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;gt;&amp;gt;&amp;gt; mxd.saveACopy("c:/output/base_93.mxd", "9.3")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/MapDocument/00s30000000n000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/MapDocument/00s30000000n000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 16:44:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359246#M12413</guid>
      <dc:creator>DavidWynne</dc:creator>
      <dc:date>2010-08-03T16:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359247#M12414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks but I know that already.&amp;nbsp; I need to save the MXD out to the same version of ArcGIS.&amp;nbsp; So if it's 9.3 I want to save to 9.3 but if it is 9.2 it needs to be saved as 9.2.&amp;nbsp; I notice that if you leave out the version keyword it upgrades the MXD to 10.0.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 20:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359247#M12414</guid>
      <dc:creator>RandyKreuziger</dc:creator>
      <dc:date>2010-08-03T20:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359248#M12415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks but I know that already.&amp;nbsp; I need to save the MXD out to the same version of ArcGIS.&amp;nbsp; So if it's 9.3 I want to save to 9.3 but if it is 9.2 it needs to be saved as 9.2.&amp;nbsp; I notice that if you leave out the version keyword it upgrades the MXD to 10.0.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No, not possible in Python in ArcGIS 10 to tell what release a mapdocument is currently saved as (I'm told possibly at 10.1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 20:38:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359248#M12415</guid>
      <dc:creator>DavidWynne</dc:creator>
      <dc:date>2010-08-03T20:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359249#M12416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is is possible to determine .mxd version from within ArcMap itself?&amp;nbsp; It's not listed in Map Document Properties (I'm using v10.0), where I thought it should be.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2012 18:52:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359249#M12416</guid>
      <dc:creator>LinkElmore</dc:creator>
      <dc:date>2012-11-06T18:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359250#M12417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;No, not possible in Python in ArcGIS 10 to tell what release a mapdocument is currently saved as (I'm told possibly at 10.1)&lt;BR /&gt;-Dave&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Assuming you're still out there do you know if this got added to 10.1?&amp;nbsp; I really need that able in a script I'm writing that strips out broken map service datasources.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:32:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359250#M12417</guid>
      <dc:creator>RandyKreuziger</dc:creator>
      <dc:date>2013-10-11T15:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359251#M12418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone from ESRI answer this question?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am currently running a similar script in v10.0 where it is not possible.&amp;nbsp; Once this script has processed all my organization's mxds and lyr files, I will be upgrading my enterprise GIS environment to v10.2.&amp;nbsp; I will need to run this script again in the v10.2 environment when my organization upgrades our SDE Oracle database from 11g to 12c, so this capability would be useful if it is now available at v10.2.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:38:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359251#M12418</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-10-11T15:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359252#M12419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Dave,&lt;BR /&gt;&amp;nbsp; Assuming you're still out there do you know if this got added to 10.1?&amp;nbsp; I really need that able in a script I'm writing that strips out broken map service datasources.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alas, no.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did see this strategy listed under the answer section that seems to hold though: &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/62090/arcpy-method-to-determine-arcmap-document-version"&gt;http://gis.stackexchange.com/questions/62090/arcpy-method-to-determine-arcmap-document-version&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 20:55:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359252#M12419</guid>
      <dc:creator>DavidWynne</dc:creator>
      <dc:date>2013-10-24T20:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359253#M12420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Alas, no.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I did see this strategy listed under the answer section that seems to hold though: &lt;A href="http://gis.stackexchange.com/questions/62090/arcpy-method-to-determine-arcmap-document-version"&gt;http://gis.stackexchange.com/questions/62090/arcpy-method-to-determine-arcmap-document-version&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a very clever solution. Very useful!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 18:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359253#M12420</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2013-10-25T18:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359254#M12421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know this is an old thread, but here is some code I wrote to do the trick.&amp;nbsp; It can be incorporated into a loop for multiple MXDs.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; re
mxdFile &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:\\temp\\map_document.mxd"&lt;/SPAN&gt;
mxd101 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.1'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'\u0013'&lt;/SPAN&gt;
mxd102 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.1'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'\u0013'&lt;/SPAN&gt;
mxd103 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.3'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'\u0014'&lt;/SPAN&gt;
mxd104 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.4'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'\u0015'&lt;/SPAN&gt;
mxd105 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.5'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'\u0016'&lt;/SPAN&gt;
mxd106 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.6'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'\u0017'&lt;/SPAN&gt;
mxdList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;mxd101&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mxd102&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mxd103&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mxd104&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mxd105&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mxd106&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; open&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxdFile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'rb'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; mxd&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   fileContents &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mxd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;read&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;decode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'latin1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
   removedChars &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;x &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; x &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fileContents &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; x &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;u&lt;SPAN class="string token"&gt;'\xff'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;u&lt;SPAN class="string token"&gt;'\x00'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;u&lt;SPAN class="string token"&gt;'\x01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;u&lt;SPAN class="string token"&gt;'\t'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
   joinedChars &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;removedChars&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; m &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; mxdList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   location &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; joinedChars&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;find&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;m&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;joinedChars&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;location&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;location&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   result&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;joinedChars&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;location&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;location&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:46:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/359254#M12421</guid>
      <dc:creator>WilliamCraft</dc:creator>
      <dc:date>2021-12-11T16:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/1092972#M25775</link>
      <description>&lt;P&gt;Hi William - thanks for keeping the thread alive!&lt;/P&gt;&lt;P&gt;I'm trying to get your code to work in the Python window in Arc, but (I think) the indenting is screwing me up. I keep getting "IndexError: list index is out of range" for the last line, which I take to mean that the result list is empty.&lt;/P&gt;&lt;P&gt;Is there a way to share the python code with the indent formatting in tact, like used to be possible on GeoNet?&lt;/P&gt;&lt;P&gt;FYI: I'm using ArcMap 10.7.1 and trying the code on an MXD (I believe) I saved down to 10.3.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 23:38:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/1092972#M25775</guid>
      <dc:creator>JoeBryant1</dc:creator>
      <dc:date>2021-08-26T23:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/1093081#M25776</link>
      <description>&lt;P&gt;William's code was messed up, the indenting that is, in the transition from the old GeoNet hosting platform to the new hosting platform.&amp;nbsp; It happened to a lot of code.&amp;nbsp; Below is William's code reformatted.&amp;nbsp; Just note that MXDs with versions newer than 10.6 will likely cause code to fail unless you update the code to include newer versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although fixing indentation is a nuisance, being able to do it successfully is a critical step in learning and understanding Python.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os, sys, arcpy, re

mxdFile = "C:\\temp\\map_document.mxd"
mxd101 = '10.1' + u'\u0013'
mxd102 = '10.1' + u'\u0013'
mxd103 = '10.3' + u'\u0014'
mxd104 = '10.4' + u'\u0015'
mxd105 = '10.5' + u'\u0016'
mxd106 = '10.6' + u'\u0017'

mxdList = [mxd101, mxd102, mxd103, mxd104, mxd105, mxd106]
result = []

with open(mxdFile, 'rb') as mxd:
    fileContents = mxd.read().decode('latin1')
    removedChars = [x for x in fileContents if x not in [u'\xff',u'\x00',u'\x01',u'\t']]
    joinedChars = ''.join(removedChars)
    for m in mxdList:
        location = joinedChars.find(m)
        if len(joinedChars[location:location+4]) &amp;gt; 0:
            result.append(joinedChars[location:location+4])
            print result[0]‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 13:19:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/1093081#M25776</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-08-27T13:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy, Determine what version an MXD is?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/1093209#M25778</link>
      <description>&lt;P&gt;Thanks for the quick fix, Joshua! That's the same indenting I ended up with, I was just doubting myself when I wasn't getting the results I expected.&lt;/P&gt;&lt;P&gt;I was running this on an MXD I thought I saved down to 10.3, using the saveACopy function from ArcPy. I was hoping to use William's code to verify it worked, but the result list is empty for any of the MXDs I save down with my custom Python Tool. However, I just tested William's code on an MXD I saved a copy of at 10.3 using the ArcMap 10.7.1 GUI, and his code &lt;EM&gt;did&lt;/EM&gt; work, returning "10.3". So it looks like my saveACopy Python tool, based on the code &lt;A title="How To: Save map documents in ArcGIS 10.x as previous version of ArcGIS in batch" href="https://support.esri.com/en/technical-article/000011219" target="_blank" rel="noopener"&gt;here&lt;/A&gt;, is either not working properly, or the binary structure of the saved MXD's fileContents no longer matches the format this code is intended to interpret.&lt;/P&gt;&lt;P&gt;FYI: I've also added:&lt;/P&gt;&lt;P&gt;mxd107 = '10.7' + u'\u0018'&lt;/P&gt;&lt;P&gt;to the declared variables and added mxd107 to the mxdList, and can confirm that this will work on MXDs saved at 10.7.&lt;/P&gt;&lt;P&gt;Can we assume that&amp;nbsp;mxd108 = '10.8' + u'\u0019' ?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 17:05:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-determine-what-version-an-mxd-is/m-p/1093209#M25778</guid>
      <dc:creator>JoeBryant1</dc:creator>
      <dc:date>2021-08-27T17:05:42Z</dc:date>
    </item>
  </channel>
</rss>

