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

In This Topic
    UnSelectElements Method (LayoutView)
    In This Topic
    Unselect the elements within the layout view. This method must be called on the MCT. Use QueuedTask.Run.
    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
    This method or property must be called within the lambda passed to QueuedTask.Run.
    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.
    The layout view displaying the elements should be initialized.
    Example
    UnSelect elements on the LayoutView
    LayoutView layoutView = LayoutView.Active;
    //Unselect one element.
    var elementToUnSelectInView = layout.FindElements(new List<string>() { "MyPoint" }).FirstOrDefault();
    layoutView.UnSelectElement(elementToUnSelect);
    //Unselect multiple elements.
    var elementsToUnSelectInView = layout.FindElements(new List<string>() { "Point 1", "Line 3", "Text 1" });
    layoutView.UnSelectElements(elementsToUnSelect);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also