ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / Project Class / CreateAsync(CreateProjectSettings) Method
(optional) The settings that will be use to create a new project. (default value = null)CreateProjectSettings
Example

In This Topic
    CreateAsync(CreateProjectSettings) Method
    In This Topic
    Creates a new project with properties determined by CreateProjectSettings
    Syntax
    Public Shared Function CreateAsync( _
       Optional ByVal createProjectSettings As CreateProjectSettings _
    ) As Task(Of Project)

    Parameters

    createProjectSettings
    (optional) The settings that will be use to create a new project. (default value = null)CreateProjectSettings

    Return Value

    A Task returning the new project that was created
    Exceptions
    ExceptionDescription
    Path { path here } not found.
    Remarks

    To create a project with system defaults, please use the CreateProjectSettings.TemplateType property. Use of the system templates via the template path is deprecated as of 2.3.
    The default TemplateType is TemplateType.Catalog. Either set a different TemplateType (as needed) or provide a full path to a Pro project template in TemplatePath, in which case the TemplateType is ignored.
    If CreateProjectSettings is null, a new untitled project is created (TemplateType.Untitled).

    An invalid CreateProjectSettings.TemplatePath will throw a "Path { path here } not found" FileNotFoundException. This includes use of a portal or online Pro project template item URI. The template should be downloaded first.

    Example
    Create a new project
    {
      //Create a new project using Pro's default settings
      var defaultProjectSettings = Project.GetDefaultProjectSettings();
      var project = Project.CreateAsync(defaultProjectSettings).Result;
    
      // Use project
    }
    Create a new project with specified name
    {
      //Settings used to create a new project
      CreateProjectSettings projectSettings = new()
      {
        //Sets the name of the project that will be created
        // example: projectName =  @"C:\Data\MyProject1\MyProject1.aprx"
        Name = projectName
      };
      //Create the new project
      var project = Project.CreateAsync(projectSettings).Result;
    
      // Use project
    }
    Create new project using Pro's default settings
    {
      //Get Pro's default project settings.
      var defaultProjectSettings = Project.GetDefaultProjectSettings();
      //Create a new project using the default project settings
      var project = Project.CreateAsync(defaultProjectSettings).Result;
    
      // Use project
    }
    New project using a custom template file
    {
      //Settings used to create a new project
      CreateProjectSettings projectSettings = new()
      {
        //Sets the project's name
        Name = projectName,
        //Path where new project will be stored in
        LocationPath = @"C:\Data\NewProject",
        //Sets the project template that will be used to create the new project
        TemplatePath = @"C:\Data\MyProject1\CustomTemplate.aptx"
      };
      //Create the new project
      var project = Project.CreateAsync(projectSettings).Result;
    
      // Use project
    }
    Create a project using template available with ArcGIS Pro
    {
      //Settings used to create a new project
      CreateProjectSettings proTemplateSettings = new()
      {
        //Sets the project's name
        Name = projectName,
        //Path where new project will be stored in
        LocationPath = @"C:\Data\NewProject",
        //Select which Pro template you like to use
        TemplateType = TemplateType.Catalog
        //TemplateType = TemplateType.LocalScene
        //TemplateType = TemplateType.GlobalScene
        //TemplateType = TemplateType.Map
      };
      //Create the new project
      var project = Project.CreateAsync(proTemplateSettings).Result;
    
      // Use project
    }
    Create Project with Template
    {
      var projectFolder = Path.Combine(
          Environment.GetFolderPath(
              Environment.SpecialFolder.MyDocuments),
          @"ArcGIS\Projects");
      CreateProjectSettings ps = new()
      {
        Name = projectName,
        LocationPath = projectFolder,
        TemplatePath = templatePath
      };
      var project = Project.CreateAsync(ps).Result;
      //Use project;
    }
    Create an empty project
    {
      //Create an empty project. The project will be created in the default folder
      //It will be named MyProject1, MyProject2, or similar...
      var project = Project.CreateAsync().Result;
    
      // Use project
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.6 or higher.
    See Also