Tuesday 11 July 2017

arcmap - Changing data source for all layers in MXD?


I have an MXD. It connects to about 30 layers in one of our SDE databases. I want to change the SDE database they connect to.


Is there a way to do this without having to right-click every layer and change it individually?



Answer



Right click on the mxd in ArcCatalog, click on Set data sources, and bulk change from there. However, this tool warns:




Note: this dialog is intended primarily for preparing map documents for publication. Customizations (VBA code, UI Controls and custom toolbars), graphs, and table window appearance properties are removed from .mxd files when you update their data sources using this dialog. To preserve these, update the data sources in ArcMap instead.



You could also use the arcpy.mapping python library:


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...