Creating model processes


The way you build models is by building and connecting processes. A process is simply a tool plus its variables. A variable is either a data variable that references data on disk, or a value variable, which is anything else, such as numbers and text strings. Variables are connected to tool parameters.

Learn more about processes

Learn more about variables

Adding tools

You typically start building a process by adding a tool to the ModelBuilder diagram. You can either drag and drop the tool from ArcToolbox or ArcCatalog, or use the Add Data tool Add data tool on the ModelBuilder toolbar. When using the Add Data tool to add a tool, browse to the Toolboxes folder, as shown below.

Adding tools using Add Data

When you first add a tool to a model, an empty derived output variable is automatically created from the tool's output parameter. In the following illustration, the Buffer tool was added to a model, and a new, empty variable was created for the output feature class. You can connect this output as input to another tool. All tools added to ModelBuilder will create an output variable even if no output is shown in the tool's dialog or in Command Line.

Newly added tool

Adding model tools

You can embed models within models, because models are just like any other tool. For model tools, you can right-click the model tool and click Edit to open the model inside its own ModelBuilder application.

If you add a model tool and it doesn't have any output data as shown below, there might be a problem in the added tool.

Embeded model without output parameter

You may need to edit the added model to make its output variable a model parameter (see Model parameters for more information). Once you do so, the added model tool should have output data connected to it, as shown below.

Model tool with output

A common problem is to forget to make a model's output a model parameter. This is not necessarily an error—the tool author may have intentionally written the model so that it's output is not a parameter.

Added models can either be in a ready-to-run state, as shown above, or in a not-ready-to-run state, where the tool and output are white.

Adding project data

Project data is input data that exists on disk, rather than derived data created by a model.

Learn more about project data

There are three ways of adding project data. Depending on how you add project data, ModelBuilder will add a connection to the appropriate parameter in a tool. For example, if you drag and drop data from ArcCatalog, or use the Add Data tool Add data tool, a project data variable will be created, but will not be connected to the tool, as shown below.

Unconnected data

In such cases, you'll have to add the connection yourself.

Learn more about connecting data to tools

Method 1: Drag and drop

Method 2: Add Data button

You can use the Add Data button Add data. After adding the data, you need to connect the data to the appropriate tool.

Method 3: Using the tool dialog

You can add data by opening the tool's dialog. Right-click the tool and click Open, or double-click the tool. For any input dataset parameter, you can browse to disk, or select a layer or model variable from the drop-down list.

Overlapping elements

Be aware that sometimes when you add data, the newly created data element (the oval) may be placed on top of an existing data element, making it appear as if the existing data element was deleted. In such cases, simply move the newly added data by clicking the Select Element tool Select element tool, then click and hold the mouse on the added data and move it. You can also use the Auto Layout button Auto layout tool.

Learn more about auto layout and model appearance

Connecting data to tools

There are two ways you can connect data elements to tool elements, either by using the Connect tool Connect tool or the tool's dialog.

To use the Connect tool:

  1. Click the Connect tool.
  2. Click the data element you want to connect to a tool.
  3. Click the tool to which you want to connect the data.

A connection will be made between the data and the tool.

NOTE: You can connect a data element (or any variable) to any number of tools.

To use the tool's dialog, right-click the tool and click Open or double-click the tool. For any input dataset parameter, you can use the parameter's user interface control to browse to disk, or select a layer or model variable from the drop-down list.

Displaying possible connections

By default, when you use the Connect tool to connect data to tools, the data is assumed to be the tool's first input dataset. For example, the Clip tool takes two polygon feature classes, the input features and the clip features. The first time you connect a polygon feature class to the Clip tool, it will connect to the input features parameter. The second feature class will connect to the clip features parameter.

You can override this behavior by instructing ModelBuilder to display a list of valid parameters when connecting data to tools, as follows:

  1. On the Tools menu of the ArcGIS application you're working in, such as ArcCatalog or ArcMap, click Options.
  2. Click the Geoprocessing tab.
  3. Check the display valid parameters option, as shown below.
  4. Display valid parameters option

NOTE: There's no need to exit ModelBuilder to check this option—you can check it while you're working in ModelBuilder.

After checking this option, anytime you connect data to a tool, you'll get a message box asking you which parameter you want to connect to. Below is an example of connecting a polygon feature class Lakes.shp to the Clip tool:

Parameter choice display

Setting output data parameters

Most tools will automatically set the output dataset pathname for the tool's derived data element once you give values to the tool's input dataset parameters. When the model is run, the output dataset will be written to this location. The output pathname is generated based on the model's environment settings or the pathname of the first input dataset.

There are two environment settings that control the output pathname; scratch workspace and current workspace.

Learn more about model environments

Learn more about controlling tool results

Changing the output pathname

You can always change the auto-generated output pathname. Either open the tool dialog and enter a new output name, or open the variable and enter a new name. If the output variable is in/out derived data, you cannot change its value by opening the variable—you must either change the input variable or use the tool dialog.

Setting other parameter values

The above sections describe how to set values for data parameters. For all other parameters, you can set them by opening the tool's dialog, or by creating variables from the tool's parameters and setting these variables.

Learn more about creating and setting parameters

Once all required parameters have been set, the tool will change from the not-ready-to-run state (white) to the ready-to-run state (yellow).

Connecting processes

You connect processes by connecting the output variable of one tool to another tool.

Learn more about connecting variables

See Also