for dirpath, dirnames, filenames in arcpy.da.Walk():
def filter_function(walk): for dirname, subdirs, items in walk: new_items = [] for item in items: description = arcpy.Describe(os.path.join(dirname, item)) if description.dataType == "FeatureClass": if description.featureType != "Annotation": new_items.append(item) else: new_items.append(item) yield dirname, subdirs, new_items for dirpath, dirnames, filenames in filter_function(arcpy.da.Walk(workspace)): # Something interesting goes here
I don't think it's directly supported, but you could add a filter function like this:def filter_function(walk): for dirname, subdirs, items in walk: new_items = [] for item in items: description = arcpy.Describe(os.path.join(dirname, item)) if description.dataType == "FeatureClass": if description.featureType != "Annotation": new_items.append(item) else: new_items.append(item) yield dirname, subdirs, new_items for dirpath, dirnames, filenames in filter_function(arcpy.da.Walk(workspace)): # Something interesting goes here
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.