<?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: Why does this Arcpy Script Execute - but Fail to Accomplish Objective in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129029#M10010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe it uses a default template during the transition, if so, I suppose you can set it somewhere before running the script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Apr 2015 21:00:27 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2015-04-29T21:00:27Z</dc:date>
    <item>
      <title>Why does this Arcpy Script Execute - but Fail to Accomplish Objective</title>
      <link>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129026#M10007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to simply change the workspace paths for a folder full of mxds at a time.I came across this script which executes in the Python Window of Arcmaap without an error message being thrown. Unfortunately, when I open an mxd in the folder to check results nothing has changed - it still points to the old workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The workspace I am trying to have the Arcpy script repoint to is an SDE Workspace being served by Sequal Server Express. I read that there are "known issues" with SSExpress. Am I doomed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other Arcpy attempts to just swap the workspaces of a single mxd - also repointing to SDE have had some success - if "saveACopy"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any assistance is appreciated. Here's the script that doesn't error out or accomplish the task either. Thanks in advance - Jim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; folderPath = r"G:\Projects\Utilities"&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; for filename in os.listdir(folderPath):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fullpath = os.path.join(folderPath, filename)&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if os.path.isfile(fullpath):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; basename, extension = os.path.splitext(fullpath)&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if extension.lower() == ".mxd":&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(fullpath)&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.findAndReplaceWorkspacePaths(r"N:\SDE_Backup_2014\Shapefiles.gdb", r"Database Connections\Connection to usmasvgdpw01.sde")&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.save()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 16:33:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129026#M10007</guid>
      <dc:creator>JamesLabate</dc:creator>
      <dc:date>2015-04-29T16:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this Arcpy Script Execute - but Fail to Accomplish Objective</title>
      <link>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129027#M10008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00s30000004p000000"&gt;the help files &lt;/A&gt;&lt;/P&gt;&lt;P&gt;Would this not be your scenario?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="arcpyref"&gt;&lt;A class="xref" href="http://resources.arcgis.com/en/help/main/10.2/00s3/00s30000000n000000.htm" rel="/en/help/main/10.2/00s3/00s30000000n000000.htm"&gt;MapDocument.replaceWorkspaces&lt;/A&gt;(old_workspace_path, old_workspace_type, new_workspace_path, new_workspace_type, {validate})&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;The &lt;SPAN class="arcpyref"&gt;replaceWorkspaces&lt;/SPAN&gt; method on the &lt;SPAN class="arcpyref"&gt;MapDocument&lt;/SPAN&gt; object is similar to the&amp;nbsp; &lt;SPAN class="arcpyref"&gt;findAndReplaceWorkspacePaths&lt;/SPAN&gt; method but also allows you to switch from one workspace type to another (for example, personal geodatabase to file geodatabase).&amp;nbsp; Generally, this method&amp;nbsp; works on one workspace type at a time. If more than one workspace type needs to be replaced, use the method multiple times for each workspace type.&amp;nbsp; See the "General usage notes" section below for other alternative usages.&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 16:45:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129027#M10008</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-04-29T16:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this Arcpy Script Execute - but Fail to Accomplish Objective</title>
      <link>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129028#M10009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan,&lt;/P&gt;&lt;P&gt;That method did work - strange side effect though - the mxds page size defaulted to leter when they were all originally 11X17. Anything in the code causing that?&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 20:38:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129028#M10009</guid>
      <dc:creator>JamesLabate</dc:creator>
      <dc:date>2015-04-29T20:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this Arcpy Script Execute - but Fail to Accomplish Objective</title>
      <link>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129029#M10010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe it uses a default template during the transition, if so, I suppose you can set it somewhere before running the script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 21:00:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-this-arcpy-script-execute-but-fail-to/m-p/129029#M10010</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-04-29T21:00:27Z</dc:date>
    </item>
  </channel>
</rss>

