<?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: findAndReplaceWorkspacePaths function Fails On Empty MXDs in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-function-fails-on/m-p/191510#M2099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jim.&amp;nbsp; The try/catch worked just fine.&amp;nbsp; The script is running as I type.&amp;nbsp; Have a good one.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jul 2013 13:39:09 GMT</pubDate>
    <dc:creator>EricMahaffey</dc:creator>
    <dc:date>2013-07-29T13:39:09Z</dc:date>
    <item>
      <title>findAndReplaceWorkspacePaths function Fails On Empty MXDs</title>
      <link>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-function-fails-on/m-p/191508#M2097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know, I know who would want to repair the datasources on an MXD that has not layers in it.&amp;nbsp; Technically not me, however, I was tasked to help some people who have created several empty files amongst a whole mess of other ones in various folders.&amp;nbsp; My Python script runs just fine until it come across an MXD with no data layers, then it errors out saying:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "D:/Users/Tools/Repair Data Sources/Scripts/repair_mxd_sources_production_2.py", line 45, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outputMXDname = newmxdname.saveACopy(root + "\\" + inputmxdname.strip(".mxd") + "_Source_Repaired.mxd")&lt;BR /&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)&lt;BR /&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\_mapping.py", line 828, in saveACopy&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self._arc_object.saveACopy(file_name)&lt;BR /&gt;AttributeError: MapDocObject: Unable to save.&amp;nbsp; Check to make sure you have write access to the specified file and that there is enough space on the storage device to hold your document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure why it's having an issue saving an empty file.&amp;nbsp; Is there any way to get it to ignore MXDs with no data?&amp;nbsp; Maybe even ignore ones that have a file size of 5KB or below?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2013 11:39:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-function-fails-on/m-p/191508#M2097</guid>
      <dc:creator>EricMahaffey</dc:creator>
      <dc:date>2013-07-29T11:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: findAndReplaceWorkspacePaths function Fails On Empty MXDs</title>
      <link>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-function-fails-on/m-p/191509#M2098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use a Try... Except statement. This allows you to handle exceptions, like not having any layers to findAndReplaceWorkspacePaths on. Using this will allow you to continue on past the empty map documents.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2013 12:26:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-function-fails-on/m-p/191509#M2098</guid>
      <dc:creator>JimCousins</dc:creator>
      <dc:date>2013-07-29T12:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: findAndReplaceWorkspacePaths function Fails On Empty MXDs</title>
      <link>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-function-fails-on/m-p/191510#M2099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jim.&amp;nbsp; The try/catch worked just fine.&amp;nbsp; The script is running as I type.&amp;nbsp; Have a good one.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2013 13:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-function-fails-on/m-p/191510#M2099</guid>
      <dc:creator>EricMahaffey</dc:creator>
      <dc:date>2013-07-29T13:39:09Z</dc:date>
    </item>
  </channel>
</rss>

