ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Layout Class / UnSelectElements Method
The selected elements to unselect. If null then all elements are unselected.
Example

In This Topic
    UnSelectElements Method (Layout)
    In This Topic
    Unselect the elements on the page layout.
    Syntax
    public void UnSelectElements( 
       IEnumerable<Element> elements
    )
    Public Sub UnSelectElements( _
       Optional ByVal elements As IEnumerable(Of Element) _
    ) 

    Parameters

    elements
    The selected elements to unselect. If null then all elements are unselected.
    Exceptions
    ExceptionDescription
    elements must belong to layout 'URI'
    Remarks
    If a child of a group element is provided in the list of elements to be unselected in addition to its parent then the parent is the element unselected.
    Example
    UnSelect elements on the Layout
    //Unselect one element.
    var elementToUnSelect = layout.FindElements(new List<string>() { "MyPoint" }).FirstOrDefault();
    layout.UnSelectElement(elementToUnSelect);
    //Unselect multiple elements.
    var elementsToUnSelect = layout.FindElements(new List<string>() { "Point 1", "Line 3", "Text 1" });
    layout.UnSelectElements(elementsToUnSelect);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also