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.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.