ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / VoxelLayer Class / CanUnlockSection Method
The definition of the locked section to determine whether it can be unlocked
Example

In This Topic
    CanUnlockSection Method
    In This Topic
    Determine whether a section can be unlocked.
    Syntax
    Public Function CanUnlockSection( _
       ByVal lockedSectionDef As LockedSectionDefinition _
    ) As Boolean
    public bool CanUnlockSection( 
       LockedSectionDefinition lockedSectionDef
    )

    Parameters

    lockedSectionDef
    The definition of the locked section to determine whether it can be unlocked

    Return Value

    True if the specified section can be unlocked.
    Exceptions
    ExceptionDescription
    Locked section is null
    Locked section not found in the collection of sections
    Example
    Unlock a Locked Section
    {
      // Note: call within QueuedTask.Run()
      {
        if (voxelLayer.Visualization != VoxelVisualization.Surface)
          voxelLayer.SetVisualization(VoxelVisualization.Surface);
        voxelLayer.SetSectionContainerExpanded(true);
        voxelLayer.SetSectionContainerVisibility(true);
        voxelLayer.SetLockedSectionContainerExpanded(true);
    
        //get the selected locked section
        var locked_section = MapView.Active.GetSelectedLockedSections().FirstOrDefault();
        if (locked_section == null)
          locked_section = voxelLayer.GetLockedSections().FirstOrDefault();
        if (locked_section == null)
          return;
    
        //Unlock the locked section (Deletes the locked section, creates
        //a section)
        if (voxelLayer.CanUnlockSection(locked_section))
          voxelLayer.UnlockSection(locked_section);
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also