Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

help me with this script please.

$
0
0
Hello group,
How can I Find all broken data sources in all map documents in a folder or a hard drive?

I'm trying to use this script but i always recieve an error

import arcpy.mapping as mapping, os
path = r"C:"
f = open('filename_here.txt','w')
for root,dirs,files in os.walk(path):
for filename in files:
basename, extension = os.path.splitext(filename)
if extension == ".mxd":
fullPath = os.path.join(path,filename)
mxd = mapping.MapDocument(fullPath)
f.write("MXD: " + filename + "\n")
brknList = mapping.ListBrokenDataSources(mxd)
for brknItem in brknList:
f.write("\t" + brknItem.name + "\n")
f.close()

so please help me with this.
Thank you.

Viewing all articles
Browse latest Browse all 2485

Trending Articles