ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / CatalogLayerCreationParams Class
Members Example

In This Topic
    CatalogLayerCreationParams Class
    In This Topic
    Represents an object to initialize and create a CatalogLayer with pre-defined properties.
    Object Model
    CatalogLayerCreationParams ClassCatalogDataset ClassLayer ClassLayer ClassLayer ClassLayer ClassLayer ClassCIMDataConnection ClassDefinitionQuery ClassItem ClassCIMLayerDocument Class
    Syntax
    Public Class CatalogLayerCreationParams 
       Inherits LayerCreationParams
    public class CatalogLayerCreationParams : LayerCreationParams 
    Example
    Create Catalog Layer using Uri to a Catalog Feature Class
    {
        var createParams = new CatalogLayerCreationParams(new Uri(@"C:\CatalogLayer\CatalogDS.gdb\HurricaneCatalogDS"));
        //Set the definition query
        createParams.DefinitionQuery = new DefinitionQuery("Query1", "cd_itemname = 'PuertoRico'");
        //Set name of the new Catalog Layer
        createParams.Name = "PuertoRico";
        //Create Layer
        //Note: Needs QueuedTask to run
        var catalogLayer = LayerFactory.Instance.CreateLayer<CatalogLayer>(createParams, MapView.Active.Map);
    }
    Create Catalog Layer using CatalogDataset
    {
        //Get the CatalogDataset of another Catalog layer
        var existingCatalogLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<CatalogLayer>().FirstOrDefault();
        if (existingCatalogLayer != null)
        {
            var catalogDataset = existingCatalogLayer.GetCatalogDataset();
            //Configure the settings for a new Catalog layer using the CatalogDataset of an existing layer
            var catalogLyrParams = new CatalogLayerCreationParams(catalogDataset);
            catalogLyrParams.Name = "NewCatalogLayerFromAnotherCatalogLayer";
            catalogLyrParams.DefinitionQuery = new DefinitionQuery("Query1", "cd_itemname = 'Asia'");
            //Note: Needs QueuedTask to run
            LayerFactory.Instance.CreateLayer<CatalogLayer>(catalogLyrParams, MapView.Active.Map);
        }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.BaseCreationParams
          ArcGIS.Desktop.Mapping.MapMemberCreationParams
             ArcGIS.Desktop.Mapping.LayerCreationParams
                ArcGIS.Desktop.Mapping.CatalogLayerCreationParams

    Requirements

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

    ArcGIS Pro version: 3.1 or higher.
    See Also