Following are checklists you can use when creating a submission to the Model and Script Tool Gallery. In the checklists below, “local data” means that data can be found in the root folder or its subfolders (as discussed in the Submission Guidelines).

Document your tools and toolboxes

Your tools and toolboxes should be well documented. See the Desktop help topic A quick tour of documenting tools and toolboxes for more information.

General

This checklist is for all submissions. Specific checklists for models, scripts, and map documents can be found below.

  Description Why an issue What to do
Zip file cannot be larger than 30MB. 30MB is the file size limit for any submission. Remove unnecessary data, fields, representations, and domains. Use smaller datasets.
Zip file should contain the root folder, not the root folder contents. See Submission Guidelines—it helps prevent overwriting of data. Add the root folder to the zip file, not the individual contents of the root folder.
Name your toolboxes according to submission category—Case Study, Generic Tools, or Service Example. See Submission Guidelines—the naming convention helps users determine if they can use your tools immediately or if they need to examine and study them first. Right-click the toolbox, click Properties, and change the name and label of the toolbox.
Your toolbox should have an alias. Toolbox aliases are used to uniquely identify a tool in scripting. Right-click the toolbox, click Properties, and provide an alias for the toolbox. See the Desktop help topic Renaming a toolbox: name, label, and alias for more information.
Use standard subfolder names: ToolData, Doc, Scripts, and Scratch. See Submission Guidelines—if we all follow the same naming conventions, finding resources will be easier. If you rename a subfolder that contains data, be sure to reset any map layers and tools that use the original subfolder name.
Scratch folder (if you have one) should not contain data. You don’t want unnecessary data included with your submission. Delete data in scratch folder.
Scrub your data for unnecessary fields, representations, domains, temporary data, and so on. Unnecessary items can bloat the size of your submission. Too many unnecessary fields make it hard to view tables. Delete unnecessary fields, representations, domains, and temporary data.

 

Models

  Description Why an issue What to do
Model is saved with relative paths option checked. After downloading, data used by the model will not be found if absolute paths are used (the option is unchecked). Right-click the model, click Properties, then click the General tab. At the bottom of the dialog box, check Store relative path names (instead of absolute paths). See the Desktop help topic Paths explained: Absolute, relative, UNC, and URL for more information.
All data variables must reference local data. All data should go into the ToolData folder and file geodatabases within the ToolData folder. If your data variable references a layer in an ArcMap document, that layer must reference local data (see checklist for map documents below). Copy data to the ToolData folder, then open the data variable in ModelBuilder and enter the path to the data you copied to the ToolData folder.
Do not use SDE data. The user of your tool will not be able to connect to your SDE database. Create a file geodatabase in the ToolData folder, then use the Copy Features or Copy Rows tools to copy data from SDE to this local file geodatabase. Reset all model variables to use the data in the local file geodatabase.
Layer symbology files (.lyr) must be local. If your model uses layer symbology files (.lyr) to define the symbology of outputs, you need to make sure the layer files are local (in the ToolData folder). Copy the layer files to the ToolData subfolder; reset the model variable that uses the layer file.
Referenced custom tools (model and script tools that you create) are in local toolbox. If you have a model or script that references (uses) a custom model or script tool in another toolbox, the referenced toolbox must be local. Exit the application (such as ArcMap). Copy the referenced toolbox to the root folder and rename the original toolbox. Start ArcMap and edit all your models that use tools in the toolbox you just renamed. The tools from the renamed toolbox will show as an invalid tool. Double-click the invalid tool and browse to the local toolbox containing the tool. When the model has been fixed to use the local tools, you can rename your original toolbox. See the Desktop help topic Repairing a model for more information.
Check your model for “Orphan” derived data. Orphan-derived data is data output by a model, but is not intermediate or an output parameter. Such data will be left behind after the model is run and may cause errors if the output workspace doesn’t exist on the user’s computer. All derived data should either be intermediate or a model parameter. See the Desktop help topic A quick tour of managing intermediate data for more information.
Name of model is not the default tool name (for example, “Model 1”). Tools have both a name and label. Default names (such as "Model", "Model 1") do not help users understand your models. Right-click the model and click Properties. Provide a real name and a label and do not use the default name.
Model images are local. Model elements can be displayed as images rather than ovals and rectangles. These image files must be local or the images will not be displayed in ModelBuilder. Put your images in the Doc subfolder and reset all images in your model to use images in the Doc subfolder.

 

Script Tools

  Description Why an issue What to do
Tool is stored with relative path names option checked. Your script tool parameters may reference data, such as a symbology layer file. After downloading, data used in script tool parameter properties will not be found if absolute paths are used (the option is unchecked). Right-click the script tool, click Properties, then click the General tab. At the bottom of the dialog box, check Store relative path names (instead of absolute paths). See the Desktop help topic Paths explained: Absolute, relative, UNC, and URL for more information.
No absolute paths in script. The paths will not exist on the user’s computer and your script will fail. See the Desktop help topic Techniques for sharing Python scripts for a way to use relative paths and find a scratch workspace.
No need to add system toolboxes using the AddToolbox or ImportToolbox functions. System toolboxes reside in the ArcGIS install directory. There is no need to explicitly add them—they will be found automatically on the users system. You don’t want to add them because the path is an absolute path. If you need to discover the install directory, use the GetInstallInfo function.
Name of tool is not the default tool name (for example, “Script 1”). Script tools have both a name and label. Default names do not help users understand your tool. Right-click the tool and click Properties. Provide a real name and a label and do not use the default name.
Use the AddFieldDelimiters function when building select statements. There are two query syntaxes, “field” and [field], depending on database format. Your tool will fail if you don’t use the correct format. See the AddFieldDelimiters function Desktop help topic.
Use good error handling: try/except blocks and traceback. Helps users understand why a particular error occurred. See the Desktop help topic Error handling with Python.
Use the AddIDMessage function method for well-known errors. The AddIDMessage function displays the error codes introduced at 9.3 along with a link to the description of the error and possible solutions. See AddIDMessage function Desktop help topic.
Comment your code well; make it readable. Users will want to understand what your script is doing. Do them a favor and make your script code readable and well-documented. Comment your code.
Check for product and extension licenses. If your script uses a tool that is not licensed, your user will automatically receive an error message when they run your tool. However, this error message might occur after several minutes of processing. The best practice is to check for required licenses before executing the bulk of your code. See the Desktop help topics for the CheckProduct and CheckExtension functions.

 

Map Documents

  Description Why an issue What to do
Map should be stored with relative path option checked. Layers will be broken (their data source will have to be reset). In ArcMap, click the File menu and click Map Document Properties. Check the option Store relative pathnames to data sources. See the Desktop help topic Paths explained: Absolute, relative, UNC, and URL for more information. You can also look at using the Consolidate Map tool (new at version 10) to create a map document and folder of data.  
Map layers reference local data. Layers will be broken (their data source will have to be reset). Copy data into the Tooldata folder; reset each layer’s data source in ArcMap by clicking the Set Data Source button on the Source tab of the Layer Properties dialog box.
Remove old results from the Results window. Lots of results make the map document bigger and slower to open. Remove old results as described in the Desktop help topic Using the Results window.

 

Filed under: