I'm migrating my data to a new server and I have 1000's of MXD's which will have broken layers due to the new location of the data. Is there a method of sourcing all these MXD's to the new data location from multiple machines using single-use licenses? I've come across this thread a couple times with no clear answer form what I could see. Thanks
I haven't tested on 10.6, so that might be the issue. But you can try to unzip the .addin and go directly to the toolbox. Right-click on the tool and Source. See if it can find the .py script for the tool. You may need to go up a folder to find the scripts folder.
I know I have had some issues with 10.5.1 with the "store relative path" for the script doing some weird stuff (trying to look on the "C$" share) when upgrading to newer version. It was developed mainly on 10.2.x.
The only other thing might be if you have spaces in the path names. I can't remember if I handle things for that.
I've downloaded your add-in and every step works great until step 5.
I get the following error message:
I'm currently running 10.6 and here is a snippet of my "UpdateToNewDrive.csv"
You can also check our my addin /blogs/myAlaskaGIS/2015/08/31/python-addin-for-data-inventory-and-broken-link-repair?sr=search&searchId=5eee9247-23a7-4c7d-ab38-e6142d3e9749&searchIndex=0
That just made my life so much better, and it is Friday!
Just thought you could use Syntax Highlighter while writing a script here.
You can use python to script the resourcing of all your map documents.
Updating and fixing data sources with arcpy.mapping—Help | ArcGIS for Desktop
A simple example would be...
<SPAN class="keyword token">import</SPAN> arcpy mxd <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>MapDocument<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">"C:\ResourceMe.mxd"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">for</SPAN> lyr <SPAN class="keyword token">in</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListLayers<SPAN class="punctuation token">(</SPAN>mxd<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">if</SPAN> lyr<SPAN class="punctuation token">.</SPAN>isRasterLayer<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">print</SPAN> lyr<SPAN class="punctuation token">.</SPAN>dataSource wsp <SPAN class="operator token">=</SPAN> lyr<SPAN class="punctuation token">.</SPAN>workspacePath ds <SPAN class="operator token">=</SPAN> lyr<SPAN class="punctuation token">.</SPAN>datasetName lyr<SPAN class="punctuation token">.</SPAN>replaceDataSource<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">"C:\Users\userprofile\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog\DirectConnect.sde"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"SDE_WORKSPACE"</SPAN><SPAN class="punctuation token">,</SPAN> ds<SPAN class="punctuation token">,</SPAN> <SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">)</SPAN> lyr<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">=</SPAN> ds <SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN> mxd<SPAN class="punctuation token">.</SPAN>findAndReplaceWorkspacePaths<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">"C:\Users\userprofile\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog\AppSvr10.sde"</SPAN><SPAN class="punctuation token">,</SPAN>r<SPAN class="string token">"C:\Users\userprofile\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog\DirectConnect.sde"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">)</SPAN> mxd<SPAN class="punctuation token">.</SPAN>saveACopy<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">"C:\ResourceMe1.mxd"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">del</SPAN> mxd <SPAN class="keyword token">print</SPAN> complete<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.