ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / CatalogLayerCreationParams Class / CatalogLayerCreationParams Constructor / CatalogLayerCreationParams Constructor(Uri)
A System.Uri represents the path or url to a dataset or .lyrx or .lpkx file.
Example

In This Topic
    CatalogLayerCreationParams Constructor(Uri)
    In This Topic
    Creates a parameter object with a System.Uri.
    Syntax
    Public Function New( _
       ByVal uri As Uri _
    )
    public CatalogLayerCreationParams( 
       Uri uri
    )

    Parameters

    uri
    A System.Uri represents the path or url to a dataset or .lyrx or .lpkx file.
    Remarks

    Some sample paths to:

    A CatalogDataset in a FileGeodatabase C:\Data\MyFileGDB.gdb\Hurricane_CatalogDS
    A CatalogDataset from a SDE C:\Connections\MySDEConnection.sde\Hurricane_CatalogDS

    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);
    }
    Requirements

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

    ArcGIS Pro version: 3.1 or higher.
    See Also