<?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: Repair Multiple Raster Data Paths in ArcGIS Explorer Desktop Questions</title>
    <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178663#M1122</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Jeremy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is that script again, which is similar to what you tested:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd=arcpy.mapping.MapDocument(r"JeremyJones_Enbridge2012.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for lyr in arcpy.mapping.ListLayers(mxd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.....if lyr.supports("DATASOURCE"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.......mxd.findAndReplaceWorkspacePaths(r"C:\ENBRIDGE2\GIS_DATA\Imagery\July2011Aerials\", r"E:\Enbridge\GIS_DATA\Imagery\2011Aerials")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.......mxd.saveACopy(r"Temp2.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where are you running this code from? ArcMap, PythonWin, Python IDLE?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the for loop there should be one tab indent and also, after the if statement, there should be another tab indent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you taken a look at &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000004p000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000004p000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Apr 2012 15:46:32 GMT</pubDate>
    <dc:creator>KevinBurke</dc:creator>
    <dc:date>2012-04-23T15:46:32Z</dc:date>
    <item>
      <title>Repair Multiple Raster Data Paths</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178660#M1119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a mxd that has probably 100 or more rasters with broken data paths.&amp;nbsp; I'm trying to use python to fix all the datapaths.&amp;nbsp; I had the rasters grouped but have since removed them from the groupings trying to make this work.&amp;nbsp; Below is the script I have been trying to run in the python window in my mxd.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxd=arcpy.mapping.MapDocument(r"JeremyJones_Enbridge2012.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... for lyr in arcpy.mapping.ListLayers(mxd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... if lyr.supports("DATASOURCE"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.findAndReplaceWorkspacePaths(r"C:\ENBRIDGE2\GIS_DATA\Imagery\July2011Aerials\", r"E:\Enbridge\GIS_DATA\Imagery\2011Aerials")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxd.saveACopy(r"Temp2.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I keep getting an message of "Parsing error &amp;lt;type 'exceptions.IndentationError'&amp;gt;: expected an indented block (line 4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 13:21:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178660#M1119</guid>
      <dc:creator>JeremyJones1</dc:creator>
      <dc:date>2012-04-23T13:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Repair Multiple Raster Data Paths</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178661#M1120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, according to the current script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxd=arcpy.mapping.MapDocument(r"JeremyJones_Enbridge2012.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... for lyr in arcpy.mapping.ListLayers(mxd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... if lyr.supports("DATASOURCE"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxd.findAndReplaceWorkspacePaths(r"C:\ENBRIDGE2\GIS_DATA\Imagery\July2011Aerials\", r"E:\Enbridge\GIS_DATA\Imagery\2011Aerials")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxd.saveACopy(r"Temp2.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason why it is failing, is because according to Python syntax, there needs to be an indentation after the for loop and after the if statement. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd=arcpy.mapping.MapDocument(r"JeremyJones_Enbridge2012.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for lyr in arcpy.mapping.ListLayers(mxd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.supports("DATASOURCE"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.findAndReplaceWorkspacePaths(r"C:\ENBRIDGE2\GIS_DATA\Imagery\July2011Aerials\", r"E:\Enbridge\GIS_DATA\Imagery\2011Aerials")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.saveACopy(r"Temp2.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Give this a try and see if it works for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 14:57:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178661#M1120</guid>
      <dc:creator>KevinBurke</dc:creator>
      <dc:date>2012-04-23T14:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Repair Multiple Raster Data Paths</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178662#M1121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It didn't show up with an indentation so should it look like this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd=arcpy.mapping.MapDocument(r"JeremyJones_Enbridge2012.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.......for lyr in arcpy.mapping.ListLayers(mxd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...........if lyr.supports("DATASOURCE"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...............mxd.findAndReplaceWorkspacePaths(r"C:\ENBRIDGE2\GIS_DATA\Imagery\July2011Aerials\", r"E:\Enbridge\GIS_DATA\Imagery\2011Aerials")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;..................mxd.saveACopy(r"Temp2.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ran it with the indentations and am now getting this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Parsing error &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: invalid syntax (line 5)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 15:00:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178662#M1121</guid>
      <dc:creator>JeremyJones1</dc:creator>
      <dc:date>2012-04-23T15:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Repair Multiple Raster Data Paths</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178663#M1122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Jeremy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is that script again, which is similar to what you tested:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd=arcpy.mapping.MapDocument(r"JeremyJones_Enbridge2012.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for lyr in arcpy.mapping.ListLayers(mxd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.....if lyr.supports("DATASOURCE"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.......mxd.findAndReplaceWorkspacePaths(r"C:\ENBRIDGE2\GIS_DATA\Imagery\July2011Aerials\", r"E:\Enbridge\GIS_DATA\Imagery\2011Aerials")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.......mxd.saveACopy(r"Temp2.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where are you running this code from? ArcMap, PythonWin, Python IDLE?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the for loop there should be one tab indent and also, after the if statement, there should be another tab indent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you taken a look at &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000004p000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000004p000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 15:46:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178663#M1122</guid>
      <dc:creator>KevinBurke</dc:creator>
      <dc:date>2012-04-23T15:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Repair Multiple Raster Data Paths</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178664#M1123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried running it in arcMap in the python window, and in the Python IDLE window.&amp;nbsp; When I run it in the IDLE window I'm getting an error that it doesn't like the syntax for the new data path.&amp;nbsp; It looks to error out at the E.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried looking at the link you send me.&amp;nbsp; That's where I started, however they don't use any examples of drive letter changes, with new folders etc.&amp;nbsp; It seems like I have it set up right, but there must be something wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 15:58:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178664#M1123</guid>
      <dc:creator>JeremyJones1</dc:creator>
      <dc:date>2012-04-23T15:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Repair Multiple Raster Data Paths</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178665#M1124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeremy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try putting the full path to the existing mxd document in following line:mxd=arcpy.mapping.MapDocument(r"JeremyJones_Enbridge2012.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or, if this mxd is currently opened you could use the following: mxd=arcpy.mapping.MapDocument("CURRENT") and run the code within the Python Window in ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 16:46:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178665#M1124</guid>
      <dc:creator>KevinBurke</dc:creator>
      <dc:date>2012-04-23T16:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Repair Multiple Raster Data Paths</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178666#M1125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for trying to help.&amp;nbsp; When I run it in the python IDLE mode i get a syntax error at the point of where the new data path is entered.&amp;nbsp; For some reason it doesn't like what I have there.&amp;nbsp; In theory it looks correct, I've even double checked my paths to make sure I had it correct.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd=arcpy.mapping.MapDocument(r"E:\Enbridge\JeremyJones_Enbridge2012.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;....for lyr in arcpy.mapping.ListLayers(mxd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;......if lyr.supports("DATASOURCE"):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;........mxd.findAndReplaceWorkspacePaths(r"C:\ENBRIDGE2\GIS_DATA\Imagery\July2011Aerials\", r"E:\Enbridge\GIS_DATA\Imagery\2011Aerials")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;........mxd.saveACopy(r"Temp2.mxd")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 17:11:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/repair-multiple-raster-data-paths/m-p/178666#M1125</guid>
      <dc:creator>JeremyJones1</dc:creator>
      <dc:date>2012-04-23T17:11:58Z</dc:date>
    </item>
  </channel>
</rss>

