Solved! Go to Solution.
mxd = arcpy.mapping.MapDocument("current") mxd_path = mxd.filePath
you should include a "findAndReplaceWorkspacePaths" method on the "CURRENT" map document. If you acquire the path to the .mxd, you could use that within the Replace portion of the findAndReplaceWorkspacePaths, and set the workspace to the same relative path as the map.
Regards,
Jim
mxd = arcpy.mapping.MapDocument("current") mxd_path = mxd.filePath
I am trying to make a script a bit more friendly by removing the need for a user to manually alter the directory location of a workspace.
import os mxd = arcpy.mapping.MapDocument("current") mxd_path = mxd.filePath mxd_dir = os.path.dirname(mxd_path)