Interactive feature input

When specifying a geoprocessing tool's input feature data, you have the following options:

  • Select a feature layer from the map.
  • Browse to a feature class.
  • Interactive input—add a new layer and interactively create features.
Feature input modes

Note:

Not all geoprocessing tools support interactive feature input.

Create new features

To use interactive feature input with your tool, click the interactive input button Editing, then select a feature type from the menu. The feature type menu includes points, lines, polygons, and multipatches. Some of these types may not be available based on the feature types that are supported by the tool. After choosing a feature type, the following actions occur:

  • A new layer will be added to your map Contents pane, named according to the tool name, parameter name, and feature type—<Tool> <Parameter> (<Type>). This layer name will be entered into the parameter, indicating the tool will use this new layer as input. This layer represents a new feature class created in your project geodatabase.
    Note:

    The feature class name may not match the new layer name. Refer to the layer Source property to determine the feature class name and location.

  • Editing templates will be added below the parameter, which show the symbols for newly drawn features, as well as a palette of tools you can use to create features. A default tool is selected so you can immediately begin creating features on the map.
    Interactive feature input template
    Create new input features to Buffer using the point creation tool.

    Learn more about the tools used to create points, lines, polygons, and multipatches.

Note:

Interactive feature input uses the editing system to create data in a feature class. It is fundamentally the same as if you are creating data using the Create Features pane. However, your edits are automatically saved when using geoprocessing interactive feature input, as long as you do not have an existing active editing session. Automatically saving your edits ensures that the workspace will be clear of any locks, and that the tool will run in the dedicated geoprocessing thread so you can perform other tasks while the tool is running.

Note:

The last feature you create may be selected, and since most geoprocessing tools only process selected features you may want to clear the selection by clicking Map > Selection > Clear prior to running the tool.

Enter attributes for your features

Some geoprocessing tools use feature attributes as part of processing. For example, the Buffer tool has a Distance Field parameter that lets you choose a field that contains buffer distances, so that different sized buffers can be created for each feature in the input. When using interactive feature input, there are a number of generic attribute fields available for you to enter values into along with the features you create, including text, numeric, and date fields.

Use one of the following methods to enter attributes for the features you create:

  • Right-click the layer in the Contents pane and select Attribute Table. After creating a feature, enter its attributes in the attribute table view.
  • Open the Active Template pane by clicking the forward arrow Forward, then enter attributes for the features you are about to create on the map. Each feature you create will have the attributes that are currently set in the Active Template pane.
    Note:

    If you enter attributes using the Active Template pane, you will need to switch back to the Geoprocessing pane to continue entering parameters and run the tool.

Configure interactive input using feature sets

You can add the interactive feature input capability to a custom model tool or script tool using the parameter datatype Feature Set. You can configure the interactive input feature type, symbology, attribute fields, editing templates, feature creation tools, and other properties using a layer file template associated with the feature set parameter.

When you open a custom tool with a feature set parameter, the interactive input button Editing appears next to the feature set parameter. Click the button to add a new layer to the active map based on the layer file you previously saved. The new layer will be empty, having no features. The editing tools, attribute fields, and symbology of the new layer will match your configured layer file. Use the feature creation tools to draw new features on the map to use as input to the custom tool.

Follow the steps below to configure a feature set parameter for model and script tools.

Model tools

To configure interactive feature input for a custom model tool, complete the following steps:

  1. Author a layer with your desired attributes, symbology, and editing templates.
  2. Save the layer as a layer file.
  3. Create a new model tool in a toolbox.
  4. In the ribbon click ModelBuilder > Insert > Variable to add a new variable to the model.
  5. In the Variable Data Type dialog select Feature Set then click OK.
  6. Double-click the feature set variable to open the Feature Set dialog. In the Properties tab, for the Template property click the browse button Browse to browse and select the layer file you saved. Alternatively, you can select a layer from the choicelist of layers in the last active map, and it will automatically create and set the feature set template. Click OK.

    This feature set variable can now be connected to and used with any geoprocessing tool in the model that accepts feature layers as input.

  7. Right-click the feature set variable and select Parameter to make it a model parameter.
  8. Save the model.

Script tools

To configure interactive feature input for a custom script tool, complete the following steps:

  1. Author a layer with your desired attributes, symbology, and editing templates.
  2. Save the layer as a layer file.
  3. Create a new script tool in a toolbox.
  4. In the Parameters tab of the new script tool Properties dialog, enter a new parameter, and set the parameter data type as Feature Set.
  5. Click on the cell for the feature set parameter's Default property, then click the browse button Browse.
  6. Browse and select the layer file you previously saved. Click OK.
  7. Finish creating the tool.

Interactive tables

In the same way that interactive feature input allows you to add a new feature layer and draw features to use as input to a geoprocessing tool, interactive tables are also supported as input to geoprocessing tools.

To leverage an interactive table, the geoprocessing tool parameter must be a Record Set data type. The use of this interactive table is the same as described above for interactive feature input. However, you do not use editing controls embedded in the geoprocessing tool. Rather, table data entry is done in the attribute table. Record sets can be configured using the same steps as feature sets described above.