folderPath = 'C:\temp' targetDataSource = 'C:\mapping\shapefile.shp' files = os.listdir(folderPath) for curFile in files: if curFile.endswith(".txt"): for lyr in arcpy.mapping.ListLayers(curFile): if lyr.dataSource == targetDataSource: print("Outdated layer found at " + lyr.lyr_file_path)
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.