ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / BulkLayerCreationParams Class / IsVisible Property
Example

In This Topic
    IsVisible Property (BulkLayerCreationParams)
    In This Topic
    Gets and sets layer visibility for all layers. The default value is null meaning visibility is set according to the ArcGIS.Desktop.Core.MappingOptions.NewLayersVisible property.
    Syntax
    Public Property IsVisible As Nullable(Of Boolean)
    public Nullable<bool> IsVisible {get; set;}
    Remarks
    To control individual layer visibility, create the BulkLayerCreationParams with a set of LayerCreationParams objects. Set the IsVisible flag for each of the LayerCreationParams as appropriate. If this property is set on the BulkLayerCreationParams (i.e. non-null), then it will override the individual layer visibilities that are set.
    Example
    Create multiple layers with BulkLayerCreationParams 1
    {
        //Uris to the datasets for the layers to be created
        var uriShp = new Uri(@"c:\data\roads.shp");
        var uriSde = new Uri(@"c:\MyDataConnections\MySDE.sde\Census");
        var uri = new Uri(@"http://sampleserver6.arcgisonline.com/arcgis/rest/services/NapervilleShelters/FeatureServer/0");
        // Create a list of URIs to be used for creating multiple layers
        var uris = new List<Uri>() { uriShp, uriSde, uri }; ;
    
        // set the index and visibility
        var blkParams = new BulkLayerCreationParams(uris);
        blkParams.MapMemberPosition = MapMemberPosition.Index;
        blkParams.MapMemberIndex = 2;
        blkParams.IsVisible = false;
        // Create multiple layers using the BulkLayerCreationParams
        //Note: Needs QueuedTask to run
        var layers = LayerFactory.Instance.CreateLayers(blkParams, MapView.Active.Map);
    }
    Requirements

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

    ArcGIS Pro version: 3.4 or higher.
    See Also