Iterate Feature Classes (ModelBuilder)

Summary

Iterates over feature classes in a workspace or feature dataset.

Learn how Iterate Feature Classes works in ModelBuilder

Usage

  • This tool is intended for use in ModelBuilder, not in Python scripting.

  • When this tool is used in a model, the first feature class is used as a template for the output. This allows for selection of fields in subsequent tools.

  • The tool has two outputs: Output Feature Class and Name, which could be used as inline variable (e.g. %Name%) in other tools.

Syntax

arcpy.mb.IterateFeatureClasses(in_workspace, {wildcard}, {feature_type}, {recursive})
ParameterExplanationData Type
in_workspace

Workspace or feature dataset which stores the feature classes to iterate. If you define a geodatabase as your input workspace only the feature classes directly under the geodatabase will be iterated over (standalone feature classes). To iterate over all feature classes within a dataset located in the input geodatabase check the recursive option.

Workspace; Feature Dataset
wildcard
(Optional)

A combination of * and characters that help to limit the results. The asterisk is the same as saying ALL. If no wildcard is specified, all inputs will be returned. For example, it can be used to restrict Iteration over input names starting with a certain character or word (for example, A* or Ari* or Land* and so on).

String
feature_type
(Optional)

The feature type to be used as a filter. Only features of the specified type will be output. Not specifying a feature type means that all features will be output.

  • ANNOTATIONOnly annotation feature classes will be the output.
  • DIMENSIONOnly dimension feature classes will be the output.
  • EDGEOnly edge feature classes will be the output.
  • JUNCTIONOnly junction feature classes will be the output.
  • LINE Only line feature classes will be the output.
  • POINTOnly point feature classes will be the output.
  • POLYGONOnly polygon feature classes will be the output.
  • MULTIPATCHOnly multipatch feature classes will be the output.
String
recursive
(Optional)

Determines if the iterator will iterate through all sub-folders in the main workspace.

  • Checked—Will iterate through all subfolders.
  • Unchecked—Will not iterate through all subfolders.
Boolean

Derived Output

NameExplanationData Type
features

The full path to the feature class.

Feature Class
name

The name of the feature class.

String

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes