ArcGIS Pro 3.7 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 Function GetLockedSections() As IList(Of LockedSectionDefinition)
    public IList<LockedSectionDefinition> GetLockedSections()
    Example
    Get the Current Collection of Locked Sections
    {
      // Note: call within 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 my_locked_section_id = -1;
    
      var locked_section = voxelLayer.GetLockedSections().FirstOrDefault();
      var locked_section2 = voxelLayer.GetLockedSections()
                      .First(lsec => lsec.ID == my_locked_section_id);
    }
    Update Locked Section Visibility
    {
      // Note: call within 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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also