Interactively Selecting Features as a Model Parameter in Model Builder

2766
3
Jump to solution
08-17-2017 01:58 PM
DavidBuehler
Occasional Contributor III

I feel like I am either over thinking this or I am missing something.  What I would like to do is have the user pick an input layer (feature class), set the field to dissolve on, and then finally select the parcels interactively using a tool or thee tool "Select Features" from the standard toolbar.  Is this possible?

0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Esteemed Contributor

Once a geoprocessing tool starts, it is not normally interactive. Interactive tasks are normally programmed with .NET or Python plugins, not with the geoprocessing environment.

In Model Builder, you could direct your user to do the selection before starting the tool, and use Get Count to make sure less than N features are selected before doing your processing. That could easily be done with Model Builder.

You could use a feature set to have the user draw a selection box before the tool runs and use Select By Location using that feature set, again followed by Get Count to check whether anything got selected.

This is one place where Python scripting is needed instead of Model Builder: using Python scripting you can use parameter validation so that the dialog will not let you click OK and give you a warning message unless you have less than a defined number of features selected in the input layer.

View solution in original post

3 Replies
ChrisDonohue__GISP
MVP Alum

I have not tried this option, but it might do what you are looking for:

Using the interactive feature and record input controls—Help | ArcGIS for Desktop 

Chris Donohue, GISP

DavidBuehler
Occasional Contributor III

Hi Chris,

I saw that link too.  I am not sure it is possible for what I want to do.  I want to select what is already there from one of three different parcel sets, and I don't need to add anything.  The features already exist.  I just need the user to select them and feed the model.  I guess one what I know it works is use the Select Feature tool on the particular feature class/layer and then load that as the parameter value in the model.  I was hoping that you open the model, the model says, "Hey select me a layer and some parcels", then proceed.  I guess there is going to have to be a disconnect.

0 Kudos
curtvprice
MVP Esteemed Contributor

Once a geoprocessing tool starts, it is not normally interactive. Interactive tasks are normally programmed with .NET or Python plugins, not with the geoprocessing environment.

In Model Builder, you could direct your user to do the selection before starting the tool, and use Get Count to make sure less than N features are selected before doing your processing. That could easily be done with Model Builder.

You could use a feature set to have the user draw a selection box before the tool runs and use Select By Location using that feature set, again followed by Get Count to check whether anything got selected.

This is one place where Python scripting is needed instead of Model Builder: using Python scripting you can use parameter validation so that the dialog will not let you click OK and give you a warning message unless you have less than a defined number of features selected in the input layer.