ArcGIS Pro 3.1 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 bool CanUnlockSection( 
       LockedSectionDefinition lockedSectionDef
    )
    Public Function CanUnlockSection( _
       ByVal lockedSectionDef As LockedSectionDefinition _
    ) As Boolean

    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
    //var voxelLayer = ... ;
    //Must be on the 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, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also