I'm using ArcGIS 10.3
I need to automate the process of "Repair Data Source"
anyone knows what tool to use in modelbuider or python function to make a Repair Data Source
Hi Gustavo, you can use the Find and Replace Workspace Paths method:
<SPAN class="kwd">import</SPAN><SPAN class="pln"> arcpy<BR />mxd </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> arcpy</SPAN><SPAN class="pun">.</SPAN><SPAN class="pln">mapping</SPAN><SPAN class="pun">.</SPAN><SPAN class="typ">MapDocument</SPAN><SPAN class="pun">(</SPAN><SPAN class="pln">r</SPAN><SPAN class="str">"C:\Project\Project_SDE1.mxd"</SPAN><SPAN class="pun">)</SPAN><SPAN class="pln"><BR />mxd</SPAN><SPAN class="pun">.</SPAN><SPAN class="pln">findAndReplaceWorkspacePaths</SPAN><SPAN class="pun">(</SPAN><SPAN class="pln">r</SPAN><SPAN class="str">"Database Connections\Connection to GISSDE1.sde"</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> <BR /> r</SPAN><SPAN class="str">"Database Connections\Connection to GISSDE2.sde"</SPAN><SPAN class="pun">)</SPAN><SPAN class="pln"><BR />mxd</SPAN><SPAN class="pun">.</SPAN><SPAN class="pln">saveACopy</SPAN><SPAN class="pun">(</SPAN><SPAN class="pln">r</SPAN><SPAN class="str">"C:\Project\Project_SDE2.mxd"</SPAN><SPAN class="pun">)</SPAN><SPAN class="pln"><BR /></SPAN><SPAN class="kwd">del</SPAN><SPAN class="pln"> mxd</SPAN>
this tool can be used to replace me specific layers?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.