ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / SubtypeGroupLayer Class
Members Example

In This Topic
    SubtypeGroupLayer Class
    In This Topic
    Represents a composite layer with a collection of feature layers for each ArcGIS.Core.Data.Subtype of its source ArcGIS.Core.Data.FeatureClass and their visual representation and editing (when permitted).
    Object Model
    SubtypeGroupLayer ClassDefinitionQuery ClassLayer ClassCIMDataConnection ClassTimeExtent ClassCIMBaseLayer ClassElevationTypeDefinition ClassSpatialReference ClassTimeParameters ClassMap ClassILayerContainer InterfaceEnvelope ClassDefinitionQuery Class
    Syntax
    Remarks
    To create a SubtypeGroupLayer, you must call LayerFactory.CreateLayer<T> and pass in a SubtypeGroupLayerCreationParams, instead of directly using a constructor.
    Example
    Create a new SubTypeGroupLayer
    var subtypeGroupLayerCreateParam = new SubtypeGroupLayerCreationParams
    (
        new Uri(@"c:\data\SubtypeAndDomain.gdb\Fittings")
    );
    
    // Define Subtype layers
    //At 2.x - var rendererDefn1 = new UniqueValueRendererDefinition(new string[] { "type" });
    var rendererDefn1 = new UniqueValueRendererDefinition(new List<string> { "type" });
    var renderDefn2 = new SimpleRendererDefinition()
    {
      SymbolTemplate = SymbolFactory.Instance.ConstructPointSymbol(
              CIMColor.CreateRGBColor(255, 0, 0), 8, SimpleMarkerStyle.Hexagon).MakeSymbolReference()
    };
    subtypeGroupLayerCreateParam.SubtypeLayers = new List<SubtypeFeatureLayerCreationParams>()
    {
      //define first subtype layer with unique value renderer
      //At 2.x - new SubtypeFeatureLayerCreationParams(new UniqueValueRendererDefinition(new string[] { "type" }), 1),
      new SubtypeFeatureLayerCreationParams(new UniqueValueRendererDefinition(new List<string> { "type" }), 1),
    
      //define second subtype layer with simple symbol renderer
      new SubtypeFeatureLayerCreationParams(renderDefn2, 2)
    };
    
    // Define additional parameters
    //At - 2.x subtypeGroupLayerCreateParam.DefinitionFilter = new CIMDefinitionFilter()
    //{
    //  Name = "IsActive",
    //  DefinitionExpression = "Enabled = 1"
    //};
    subtypeGroupLayerCreateParam.DefinitionQuery = new DefinitionQuery(whereClause: "Enabled = 1", name: "IsActive");
    subtypeGroupLayerCreateParam.IsVisible = true;
    subtypeGroupLayerCreateParam.MinimumScale = 50000;
    
    SubtypeGroupLayer subtypeGroupLayer2 = LayerFactory.Instance.CreateLayer<SubtypeGroupLayer>(
                  subtypeGroupLayerCreateParam, MapView.Active.Map);
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Mapping.MapMember
             ArcGIS.Desktop.Mapping.Layer
                ArcGIS.Desktop.Mapping.CompositeLayer
                   ArcGIS.Desktop.Mapping.SubtypeGroupLayer

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also