access to feature class via feature dataset (Model Builder or Python)

10-20-2021 06:26 AM
New Contributor

hi arcgis community,
I have a file geodatabase that has different feature datasets and each feature dataset contains different feature classes. I would like to have a certain process automatically run on each feature class. i don't know how to access each feature class. because with a for loop I can only read my feature dataset.

0 Kudos
2 Replies
MVP Esteemed Contributor

In Model Builder, use Iterate Feature Classes (ModelBuilder)—ArcGIS Pro | Documentation

Check Recursive option as well.

Think Location
0 Kudos
Occasional Contributor III

try this:

for dataset in arcpy.ListDatasets("", "Feature"):
 print (dataset)
 for fc in arcpy.ListFeatureClasses(feature_dataset=dataset):
     print("     " +fc)


0 Kudos