ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / GroupLayer Class / CanAddSymbolLayerDrawing Method
Example

In This Topic
    CanAddSymbolLayerDrawing Method (GroupLayer)
    In This Topic
    Determine whether the group layer can have Symbol Layer Drawing added to its definition. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public bool CanAddSymbolLayerDrawing()
    Public Function CanAddSymbolLayerDrawing() As Boolean

    Return Value

    True if SLD can be added to the group layer
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    Symbol Layer Drawing, SLD, can be added to a group layer to control all the drawing of its child feature layers collectively. Child feature layers with unclassed symbols, proportional symbols, dictionary symbology, or for polygon feature layers with graduated symbols cannot participate in SLD. The group layer must have at least one child feature layer that can support SLD or CanAddSymbolLayerDrawing() will return false. CanAddSymbolLayerDrawing() will also return false if the input group layer already has SLD added (unless the SLD is invalid) or if the group layer is a child of a parent group layer that has SLD added. When SLD has been established on a parent group layer, it cannot be set for individual child group layers nor other feature layers within the group; all SLD control is set through the parent group layer.
    SLD is not available for 3D layers. It can only be set on group layers in a map or in the 2D Layers category of a scene.
    Example
    Add SLD
    QueuedTask.Run(() =>
    {
      //check if it can be added to the layer
      if (featLayer.CanAddSymbolLayerDrawing())
        featLayer.AddSymbolLayerDrawing();
    
      //ditto for a group layer...must have at least
      //one child feature layer that can participate
      if (groupLayer.CanAddSymbolLayerDrawing())
        groupLayer.AddSymbolLayerDrawing();
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also