ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / VoxelLayer Class / GetLockedSections Method
Example

In This Topic
    GetLockedSections Method
    In This Topic
    Gets the collection of locked sections
    Syntax
    public IList<LockedSectionDefinition> GetLockedSections()
    Public Function GetLockedSections() As IList(Of LockedSectionDefinition)
    Example
    Get the Current Collection of Locked Sections
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    if (voxelLayer.Visualization != VoxelVisualization.Surface)
        voxelLayer.SetVisualization(VoxelVisualization.Surface);
    voxelLayer.SetLockedSectionContainerExpanded(true);
    voxelLayer.SetLockedSectionContainerVisibility(true);
    
    var locked_sections = voxelLayer.GetLockedSections();
    
    Get a Locked Section
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    var locked_section = voxelLayer.GetLockedSections().FirstOrDefault();
    var locked_section2 = voxelLayer.GetLockedSections()
                                    .First(lsec => lsec.ID == my_locked_section_id);
    
    Update Locked Section Visibility
    //var voxelLayer = ... ;
    //Must be on the QueuedTask.Run()
    
    if (voxelLayer.Visualization != VoxelVisualization.Surface)
        voxelLayer.SetVisualization(VoxelVisualization.Surface);
    voxelLayer.SetLockedSectionContainerExpanded(true);
    voxelLayer.SetLockedSectionContainerVisibility(true);
    
    var locked_sections = voxelLayer.GetLockedSections().Where(ls => !ls.IsVisible);
    
    //Make them visible
    foreach (var locked_section in locked_sections)
    {
        locked_section.IsVisible = true;
        //apply change
        voxelLayer.UpdateSection(locked_section);
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also