How does it know which folder the MXDs are in?
What if the MXDs are in a different folder than the GDB?
import arcpy, os # Set current workspace arcpy.env.workspace = os.getcwd() # For every mxd in the current directory for mxd in os.listdir(''): if mxd.endswith('.mxd'): print "Changing paths in "+mxd+"..." mxd = arcpy.mapping.MapDocument(mxd) # Note: Back slashes seemed to be required for it to work. mxd.findAndReplaceWorkspacePaths(r"c:\junk\fgdb\python\b.gdb", r"c:\junk\fgdb\python\a.gdb") mxd.save() del mxd
I need to change from one FGDB to another.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.