Jump to content

Updating and fixing data sources with arcpy.mapping


Reyalino

Recommended Posts

Dear GIS Area,

 

I am trying to use arcpy.mapping for finding and fixing broken data links. I've followed the instructions from the ArcGIS Help but it's not success. Could somebody suggest me what happens? I am using ArcGIS 10.2.

Originally the shp files located in "F:/Data/GIS File" and it's migrated into "F:/Data/GIS". The mxd files located in "F:/Data/Example.mxd". Refer to arcgis help i wrote the scripts as quoted below, but nothing happens. Could somebody help me? 

 

 

mxd= arcpy.mapping.MapDocument (r "F:/Data/Example.mxd")

mxd.findAndReplaceWorkspacePaths (r"F:/Data/GIS File", r"F:/Data/GIS")

mxd.save ()

regards,

 

reya

Link to comment
Share on other sites

It's work now, Thanks. When I used path "/" there is no error notification come up. In python the legal path are:

 

"F:/Data", "F:\\Data", "F:\Data", usually i used this path "F:/Data" for another function, and it's works. Does every types of path has to be use for any certain function in python? or i can use all of those type of path for any function?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.

Disable-Adblock.png

 

If you enjoy our contents, support us by Disable ads Blocker or add GIS-area to your ads blocker whitelist