<?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: Changing MXD to store relative pathnames to data sources via ArcPy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243368#M18911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not in 10.0. The &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/MapDocument/00s30000000n000000/"&gt;MapDocument class has a relativePaths attribute&lt;/A&gt;&lt;SPAN&gt;, but it is read-only.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2011 18:38:45 GMT</pubDate>
    <dc:creator>JasonScheirer</dc:creator>
    <dc:date>2011-06-07T18:38:45Z</dc:date>
    <item>
      <title>Changing MXD to store relative pathnames to data sources via ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243367#M18910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just wondering if there is way via ArcPy to change an MXD to store relative pathnames to data sources. I would like to run&amp;nbsp; a Python script that loops through multiple MXDs in a given folder and changes them to relatives pathnames.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Roberto&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 15:10:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243367#M18910</guid>
      <dc:creator>RobertoFigueroa</dc:creator>
      <dc:date>2011-06-07T15:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing MXD to store relative pathnames to data sources via ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243368#M18911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not in 10.0. The &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/MapDocument/00s30000000n000000/"&gt;MapDocument class has a relativePaths attribute&lt;/A&gt;&lt;SPAN&gt;, but it is read-only.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 18:38:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243368#M18911</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-06-07T18:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Changing MXD to store relative pathnames to data sources via ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243369#M18912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Might we be able to write to this property in future releases of ArcGIS? I've heard the ArcPy Site Package may be expanded in 10.1+.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 11:06:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243369#M18912</guid>
      <dc:creator>ZackBartlett</dc:creator>
      <dc:date>2011-06-14T11:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Changing MXD to store relative pathnames to data sources via ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243370#M18913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;if this helps. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;10.1 SP1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os

#workspace to search for MXDs
Workspace = r"C:\Geo"
arcpy.env.workspace = Workspace

#list map documents in folder
mxdList = arcpy.ListFiles("*.mxd")

#set relative path setting for each MXD in list.
for file in mxdList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; #set map document to change
&amp;nbsp;&amp;nbsp;&amp;nbsp; filePath = os.path.join(Workspace, file)
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(filePath)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #set relative paths property
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.relativePaths = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; #save map doucment change
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.save()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:10:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-mxd-to-store-relative-pathnames-to-data/m-p/243370#M18913</guid>
      <dc:creator>PeterMacKenzie1</dc:creator>
      <dc:date>2021-12-11T12:10:10Z</dc:date>
    </item>
  </channel>
</rss>

