[GIS] ArcGIS 10.2 Model Builder If no selection is made, then do not append to empty feature class

arcgis-10.2arcgis-desktoparcpymodelbuilder

I'm creating a model in model builder that is very easy to construct and understand. However, I ran into a slight problem. The logic of the model is that it will take user selected features from a layer and append those selected features to an empty feature class with the same schema and field definitions. The problem here is that by default, all feature rows are returned in the Append tool if no selection is made. Is there any way to tell model builder to not append any features if there is no selection made? The final output in the empty feature classes should only be user selected features. I want to keep this automated, so I am open to a python script workaround if such a statement in python exists.

Best Answer

You can use the Get Count tool as a precondition to a tool. In the model below the buffer tool will only run if count is greater than zero and it's only greater than zero if the select by attribute tool actually selects anything.

Example model

Related Question