Label | Explanation | Data Type |
Toolbox
| The toolboxes to be consolidated. | Toolbox |
Output Folder
| The output folder that will contain the consolidated toolbox. If the specified folder does not exist, a folder will be created. | Folder |
Version (Optional) | Specifies the target ArcGIS Pro version of the consolidated toolbox. Specifying a version allows toolboxes to be used by previous versions of ArcGIS.
| String |
Summary
Consolidates one or more toolboxes into a specified output folder.
Usage
Tools and parameters may have been added or modified between the ArcGIS Pro version installed and the version specified for the Version parameter. The consolidation process will analyze the tool's properties in the current version against the target version and return warnings or errors. Review the warnings or errors carefully as they can indicate that the tool will produce different outputs.
Parameters
arcpy.management.ConsolidateToolbox(in_toolbox, output_folder, {version})
Name | Explanation | Data Type |
in_toolbox [in_toolbox,...] | The toolboxes to be consolidated. | Toolbox |
output_folder | The output folder that will contain the consolidated toolbox. If the specified folder does not exist, a folder will be created. | Folder |
version (Optional) | Specifies the target ArcGIS Pro version of the consolidated toolbox. Specifying a version allows toolboxes to be used by previous versions of ArcGIS.
| String |
Code sample
The following Python window script demonstrates how to use the ConsolidateToolbox function in the Python window.
import arcpy
arcpy.management.ConsolidateToolbox(r'C:\data\BufferPoints.tbx',
r'C:\project\Buffer_Pnts', "CURRENT")
Find and create individual consolidated folders for all of the toolboxes that reside in a specified folder.
# Name: ConsolidateToolboxEx2.py
# Description: Find all the toolboxes that reside in a specified folder and
# create a consolidated folder for each.
# import system modules
import os
import arcpy
# Set environment settings
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Toolboxes"
# Loop through the workspace, find all the toolboxes (.tbx), and create a
# consolidated folder for each toolbox found using the same name as the original
# toolbox.
for tbx in arcpy.ListFiles("*.tbx"):
print("Consolidating " + tbx)
arcpy.management.ConsolidateToolbox(tbx, os.path.splitext(tbx)[0], "CURRENT")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes