ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Core Namespace / Project Class / SetDefaultToolboxPath Method
The full path to the toolbox that will be used

In This Topic
    SetDefaultToolboxPath Method
    In This Topic
    Sets the current project's default toolbox. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void SetDefaultToolboxPath( 
       string defaultToolbox
    )
    Public Sub SetDefaultToolboxPath( _
       ByVal defaultToolbox As String _
    ) 

    Parameters

    defaultToolbox
    The full path to the toolbox that will be used
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    input path cannot be resolved as default toolbox.
    Remarks

    By default, a new toolbox is created in the project's home folder and used as its default toolbox. However, the default toolbox can be set to another existing toolbox. For example, if you create a new model from the Analysis tab on the ribbon in ArcGIS Pro, a new model is created in the default toolbox. A project is required to have a default toolbox.

    The ArcGIS Pro application settings may specify a toolbox that should always be used as the default toolbox. Anyone using the project is expected to have write access to that toolbox. If a project's default toolbox is not available in the specified location, a toolbox will be created accordingly to satisfy the default toolbox path.

    At this time, only standard toolboxes (*.tbx) in the file system should be used as a project's default toolbox. If the project's default toolbox is set to use a Python toolbox (*.pyt), creating a new model from the Analysis tab on the ribbon will fail; models can't be created in Python toolboxes.

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also