Running a model within ModelBuilder
Models can be run from within ModelBuilder or from the model tool dialog box, Python window, or in a script. When running a model within ModelBuilder, either the entire model or some selected processes can be run. When processes are running in ModelBuilder, their execution can be followed in the geoprocessing progress dialog box.
There are three ways to run a model from within ModelBuilder:
- Run Single tool—Select one tool, right-click, then click Run. Earlier processes in the chain also run if needed. Later processes in the chain do not run; however, if they are in the has-been-run process state, their state changes back to ready-to-run.
- Run Ready-to-run tools—Click Run from the Model menu or the run tool on ModelBuilder toolbar. All tools that are in a ready-to-run state run.
- Run entire model—Click Run Entire Model from the Model menu. This runs all tools that are in a ready-to-run state.
What happens when a model is run within ModelBuilder?
When a model is run, all model variables are validated, and those tools in a ready-to run state are executed. If any output variables should be added to display, the outputs are added to the ArcMap table of contents. Tools that are not in a ready-to-run state or are dependent on a tool that is not ready-to-run do not execute. There are some key differences when running a model from within ModelBuilder and running a model from its tool dialog box. When a model is run within Modelbuilder, the following apply:
- Intermediate data is preserved between model runs. This data is also preserved if the model is saved, closed, and reopened for editing. When a model is run from the tool dialog box, Intermediate data is deleted.
- All the outputs with a check mark next to Add to Display are added to the display.
- Progress will be shown in the geoprocessing progress dialog box, as the process is executing in the foreground. Models run within ModelBuilder never execute as a background process. Models executed from the tool dialog box can be run in the background.
- A result is not written to the Results window.