Examples of using ModelBuilder utilities

Examples of the ModelBuilder utilities are provided.

Calculate Value

In the following example, the Calculate Value tool is used to return a string derived from the count of records from the Select Layer By Attribute tool result using an ArcGIS Arcade expression:

Calculate Value tool example

Collect Values

In the following example, the Collect Values tool is used to create a mosaic from 99 rasters stored in the Input_CollectValue workspace (the Input Rasters variable). The Iterate Rasters tool iterates through each of the rasters in the workspace, and all the rasters are collected using the Collect Values tool. The output of the Collect Values tool, the collected values, is a multivalue of rasters and is input to the Mosaic To New Raster tool. Using the Collect Values tool in this way requires creating a submodel and making the output of the Collect Values tool a model parameter.

Collect Values tool example

Get Field Value

In the following example, the Get Field Value tool is used to find the percentage area of each polygon in a feature class.

The Input variable is a polygon feature class to the Summary Statistics tool, and the output Sum Area value is a table with one record containing the total area of all polygons. This output is connected to the Get Field Value tool.

The Get Field Value tool gets the first value from a table of the specified field, and the value is then used as an inline variable in the expression of the Calculate Field tool to find the percentage area of each polygon.

Get Field Value tool example

Parse Path

In the following example, the Parse Path tool is used to parse the input (C:\1Tool Data\InputFC.shp) to a file name, extension, path, and workspace name. The Path output has a workspace data type and is connected directly as an input parameter to the Feature Class Location parameter of the Create Feature Class tool, which accepts a workspace data type as an input. For the Copy tool, which does not have a workspace data type parameter, the Path value is passed to the tool using %Path%\Out_%Name%.%Extension%.

Parse Path tool example

Select Data

In the following example, the Select Data tool is used to copy two shapefiles to a geodatabase and merge one of the feature classes with another feature class. The Select Data tool is used to select one of the two feature classes in the geodatabase and pass it to the Merge tool.

Select Data tool example

Custom Message

In the following example, the Custom Message tool is used to generate a custom warning message if the precondition is true.

The Select Layer by Attribute tool selects a subset of the input data, and the output is connected to the If Selection Exists tool. The If Selection Exists tool tool then checks whether the input data includes a selection, and if true, the Summary Statistics tool performs a calculation based on a defined field and statistic type. Further, when the If Selection Exists tool result is true, the Custom Messagetool returns a warning message.

Custom Message tool example