ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / VoxelLayer Class / UnlockSection Method
The definition of the section to unlock
Example

In This Topic
    UnlockSection Method
    In This Topic
    Unlocks the specified section. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void UnlockSection( 
       LockedSectionDefinition lockedSectionDef
    )
    Public Sub UnlockSection( _
       ByVal lockedSectionDef As LockedSectionDefinition _
    ) 

    Parameters

    lockedSectionDef
    The definition of the section to unlock
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run
    Locked section is null
    Locked section not found in the collection of sections
    Section cannot be unlocked
    Remarks
    When a section is unlocked it is added back to the collection of (dynamic) sections.
    If a locked section cannot be unlocked then a System.ArgumentException is thrown. Refer to CanUnlockSection.
    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