Monday, August 3, 2015

Sharing Tools


The final week's lab required that we open and edit a script, updating it so that the hard-coded variables for input boundary feature and output file location parameters were set using the sys.argv[ ] code instead.  This code uses a number system beginning with 1 for the first parameter, rather than 0 which is where parameters set with GetParameter and GetParameterAsText functions use.

The next step was to edit the tool's description in ArcCatalog to make the tool more user-friendly and informative.  We added Dialog Explanations for each parameter, which shows up in the dialog box when using the tool as seen in the screenshot here on the left.  On the right is the map created by the tool which created random points and then put a buffer around each one.

The last step was to embed the script into the tool so it could be shared without adding a separate script file, and so that it could be protected with a password, which we did. 

Two other steps which are important are making sure that relative file paths are stored (check box), and that the .py extension is made visible in ArcCatalog, via the Options box.