Tuesday, July 26, 2016

GIS 4102/5103: Week 11 - Sharing Tools

For our last assignment of the semester, we worked with toolboxes and previously created scripts. We used a new expression known as sys.argv[]. With this expression, the number 1 will be used as the first parameter instead of 0, as with the arcpy.GetParameter function. Just like the arcpy.GetParameterAsText() function, the sys.argv[] always returns string objects.  However, the sys.argv[] expressions have a character limit, which might cause your parameters to get cut short if they're very long.  Therefore, it is usually recommended that you use arcpy.GetParameter or arcpy.GetParameterAsText(). 
As shown in the image below, the number of sample sites has a dialog description.  An explanation was created for all of the parameters in the Syntax section of the Item Description box.  With the explanations set, the tool is more user friendly. 
Finally, we embedded and protected the script tool.  This allows you to share the tool more easily and prevent anyone without the password from editing or even seeing the script.  You only have the option to password protect the script once it has been embedded into the tool. If the script has not been imported, the option will not be available. Shown in the image below, you'll see the results from running the tool with the correct script, as well as a description of one of the parameters in the tool dialog box. 
Overall, I really enjoyed the class this semester.  There were a few bumpy roads, but I managed to do a lot better than I originally thought I would.  I hope that someday I'll have the chance to use all of the knowledge I have gained throughout this course. 


No comments:

Post a Comment