[GIS] Setting section of ModelBuilder model as optional but also as precondition to later steps

arcgis-10.1arcgis-desktoparcmapmodelbuilder

I have a model that runs a series of reclass calculations on a Feature Layer.

I want to run several "summary statistics" tools in different locations to allow testing/ viewing of the results of the sequential reclass operations.

The "summary statistics" must be run as a precondition to the next reclass operation, because each time a new reclass is conducted, the data changes. So the point in time at which the summary statistics runs is important.

I would ideally like to be able to control these summary statistics tool runs to be optional via a single Boolean tick box. This would allow an option to run the model without all these separate summary statistics in order to reduce model run time.

Is there any way to make all the summary statistics calculations optional (e.g. via a Boolean tick-box) but still when run for the summary statistics to run in the correct locations (e.g. like a precondition).

The main issues are:

  • If the model is set with a precondition, but the Boolean tick-box is turned off then the main model will not run
  • I know I could run a copy feature from each stage of the model and save to disk, or in memory and then have the summary statistics run on those copies, however this would not result in any time saving
  • I can't use a set of make feature layers and use them as the source for the summary statistics because the underlying feature layer data changes during the model run
  • I have looked into if then else commands and branching, but I can't see how to use this, without having to make lots of copies of the data at each split when two branches are created

a section of the model - this is repeated many times

Best Answer

A solution to this issue is as follows, using a sub model.

A sub model is created which includes two branches, using the merge branch tool. One branch is created using a simple calculation such as Calculate Value 1+1. The output of the merge branch is then set as the precondition to the main model. The sub model always produces an output, so the precondition always occurs and the main model always runs.

In the sub model a Boolean tick box, set as a parameter, can then be used to set up a series of calculations that if run would then reach the merge branch tool.

This can be used to run any series of optional calculations or analysis part way through a model progress, e.g. checking Summary Statistics etc

Related Question