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.
- Create a new layer and interactively add features to it.
Not all geoprocessing tools support interactive feature input.
Depending on the types of input features that are supported by a tool, you have the option to interactively create new points, lines, polygons, or multipatches.
Create new features
When you select a feature type from the interactive input choice list , the following actions occur:
new layer will be added to your map Contents, named according to
the tool name, parameter name, and feature type: <Tool>
<Parameter> (<Type>). This layer name will be entered
into the parameter text box, indicating the tool will process this
new layer's features as input. This layer represents a new feature class created in your project geodatabase.
The feature class name may not match the new layer name. Refer to the layer Source property to determine the feature class name.
- Editing templates will be added below the tool 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. Learn more about the tools used to create points, lines, polygons, and multipatches.
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.
The last feature you create is always selected, and since most geoprocessing tools only process data in the active selection, 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.
The three ways you can enter attributes for the new features you create are as follows:
- Click Map > Selection > Attributes, and after creating a feature, enter its attributes in the Attributes pane.
- Right-click the layer in the map Contents 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 and enter attributes for the
features you are about to create. Each feature you create will have
the attributes that are currently set in the Active Template pane.
If you enter attributes using the Active Template pane, you will need to switch back to the Geoprocessing pane to continue entering parameters or to run the tool.
Configure interactive input using feature sets
You can configure interactive input symbology, attribute fields, editing templates, feature creation tools, and other properties using a layer file template associated with a feature set parameter. To configure interactive feature input for a custom script or model tool, complete the following steps:
- Author a layer with your desired attributes, symbology, and editing templates.
- Save the layer as a layer file.
- Create a new script or model tool in a toolbox.
- When defining the new tool's parameters, make the desired parameter's data type Feature Set.
- Browse to and select the layer file you saved in the parameter's Default property column.
- Finish creating the tool.
When you open this tool, the interactive input button 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 editing tools, attributes, and symbology of the new layer will match your configured layer file.
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 entry is done in the attribute table. Record sets can be configured using the same steps as feature sets described above.