Exercise 6 - Script Tool
Exercise 6 - Script Tool
Open PythonWin
File>Open to the folder …Python_ArcGIS\exercises\exercise6_scripttools\scripts
Open the Python script CostDistanceMatrix.py
The input and outputs are defined at the bottom of the script. Scroll to the bottom, and replace the hardcoded inputs with arguments.
Documentation
As the creator of the script tool, you are in the best and most knowledgeable position to give guidance to others about how to use your tool. The best way to
convey key information about using the tool is to complete tool documentation through the Item Description editor.
In the Catalog window, right-click the Cost Distance Matrix script tool and select Item Description. The Item Description window will open
Click the Edit button to begin entering help content for this tool
3
In the Item Description, you can add a graphic, search tags, summary information, usage tips, parameter syntax, code examples, and credits.
o The text file CostDistanceMatrix_help.txt at …Python_ArcGIS\exercises\exercise6_scripttools contains content for each of these sections, if you
wish to fill it out.
Click Save to save your documentation.
Close the Item Description window.
Results
Open the Cost Distance Matrix tool by double-clicking it in the toolbox
Set the input parameters as shown below, then click OK to run the script tool
Creating script tools from your standalone script files is a straightforward way to integrate your Python work into ArcGIS. These script tools can now be easily
shared and re-used, used in other geoprocessing workflows, and made into geoprocessing services in ArcGIS Server.