Species tool: Version 1 (toolbox)ΒΆ

Now we have our custom Toolbox in ArcGIS but it cannot yet do anything. Let’s first create a graphical user interface for our tool.

Defining input/output files plus additional parameters for your own Python script can be done by creating a Script -tool (i.e. user interface) into your ArcGIS toolbox:

_images/arcgis-script-tool.png

It opens a dialog where you should write some generic description of your tool such as the name of the tool and description for it (do like below):

_images/arcgis-script-description.png

Click Next, and ignore the Script File -field for now (click Next again).

Now we can add parameters to our tool which are then asked from the user when the tool is used. Parameters can be defined from the properties of your Script tool:

_images/arcgis-properties.png

From the Parameters -tab we can add the required parameters to our tool.

_images/arcgis-parameter-tab-simple.png

We can name the paramater as we like in Display name column. The Data type column determines what kind of input the user can pass to that specific parameter. It can be for example Shapefile, Folder, Field, Integer, or a Raster (see the full list by clicking a row at Data Type column).

_images/arcgis-parameter-tab-upper-version1.png

From the lower part of the dialog we can adjust the properties of individual parameter (selected in Parameters list, above) that we have added to our tool. We can for example determine the Direction of the parameter (Input or output), determine with `Filter what kind of values are valid for the parameter (e.g. list of values or range), or specify a Default value for a parameter:

_images/arcgis-parameter-tab-lower.png

You need to do these modifications in the lower pane:

  • for Output Raster dataset set Direction as Output
  • for Value field, set Obtained from as Input_Shapefile

Finally, you should end up having a nice interface for your tool that looks something similar as this:

_images/Arcpy_version1_interface.png

Next, we need to write the Python script that we run with this tool interface!