Using Model Builder and Count rows to determine which Models to Run

2419
1
02-25-2017 11:02 AM
ErickPosner
New Contributor

Hello All,

I have developed two model builders - one for shapefile with 2 or more point features (that will be used to create multiple buffers and merge all buffer togethers), and one for shapefile with only one point feature.  So far, I am trying to figure how to incorporate the "If then" to direct the tool to select correct model for processing.

The initial entry point would be "Shapefile.shp" into Get Count module which outputs the Row Count, then from there, am uncertain how to do this.

Any solutions?

Thanks,

Erick

0 Kudos
1 Reply
curtvprice
MVP Esteemed Contributor

You are right to consider the Get Count tool. The output of this itool will be the row count.

  • Rename the Get Count output to an element name Point Count
  • Create two Calculate Value tools and use the expressions %Point Count% == 1  and %Point Count% > 1. Both of these CV tools should have %Point Count% as a precondition.
  • Link the output from these two Calculate Value tools as preconditions to your two model tools (these should have parameters defined so you can add them to your main model).
  • If your two model tools have a single output feature class, you can merge the two branches together with the Merge Branch tool.