How To: Create and store a custom Python system toolbox in ArcGIS Pro
The instructions provided describe to create a Python toolbox and store it as a system toolbox in ArcGIS Pro, easily accessible for any project through the Geoprocessing pane, and intended for all users.
Note: The web help document, ArcGIS Pro: Adding toolboxes in Python describes how to add a Python toolbox in ArcGIS Pro. The article also mentions the a Python toolbox can be stored as a system toolbox in ArcGIS Pro, however, the document does not provide any instructions on how to do so.
- In the Catalog pane in ArcGIS Pro, right-click the designated project folder and select New > Python Toolbox.
Note: The Catalog pane is called the Project pane in ArcGIS Pro prior to version 2.0.
- Add desired tools into the toolbox.
- Edit the toolbox in a Python IDE environment, by right-clicking toolbox > Edit. This opens the Python toolbox script in a text editor, for example, Notepad.
- Find the class Toolbox(object): section of the script.
- Set self.label and self.alias equal to the chosen name for the toolbox. The following code snippet shows the sample of what the final script looks like.
class Toolbox(object): def __init__(self): """Define the toolbox (the name of the toolbox is the name of the .pyt file).""" self.label = "ToolboxTest1" self.alias = "PythonToolbox"
- Save and close the script.
- In Windows Explorer, navigate to the folder where the toolbox is stored.
- Copy the toolbox file and its accompanying XML document(s) and paste into the following file path: