ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / IItemFactory Interface / Create Method
Example

In This Topic
    Create Method (IItemFactory)
    In This Topic
    Defines the factory create method all factories must implement.
    Syntax
    Function Create( _
       ByVal uri As String, _
       Optional ByVal itemType As ItemFactory.ItemType _
    ) As Item

    Parameters

    uri
    itemType

    Return Value

    Example
    Add a folder connection item to the current project
    {
      //Adding a folder connection
    
      //Create the folder connection project item
      var item = ItemFactory.Instance.Create(folderPath) as IProjectItem;
    
      // Note: Needs QueuedTask to run
      var folder = Project.Current.AddItem(item) ? item as FolderConnectionProjectItem : null;
    }
    Add a geodatabase item to the current project
    {
      //Adding a Geodatabase:
      //Create the File GDB project item
      // Note: Needs QueuedTask to run
      var item = ItemFactory.Instance.Create(gdbPath) as IProjectItem;
      var newlyAddedGDB = Project.Current.AddItem(item) ? item as GDBProjectItem : null;
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also