ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / CatalogLayer Class / GetCatalogDataset Method
Example

In This Topic
    GetCatalogDataset Method
    In This Topic
    Returns the underlying CatalogDataset that the catalog layer is pointing to. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetCatalogDataset() As CatalogDataset
    public CatalogDataset GetCatalogDataset()

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    A CatalogDataset is a collection of catalog dataset items, modeled as objects with a polygon representing the item footprint. Each footprint feature's attributes are properties specific to the purpose, scope, and validation status of each dataset item
    Example
    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);
        }
    }
    Requirements

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

    ArcGIS Pro version: 3.1 or higher.
    See Also