ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / LayoutView Class / Active Property
Example

In This Topic
    Active Property (LayoutView)
    In This Topic
    Gets the active layout view.
    Syntax
    Public Shared ReadOnly Property Active As LayoutView
    public static LayoutView Active {get;}
    Remarks
    Returns null if there is no active layout view.
    Example
    Reference the active layout view
    {
      //Reference the active layout view.
    
      //Confirm if the current, active view is a layout view.
      //If it is, do something.
      LayoutView activeLayoutView = LayoutView.Active;
      if (activeLayoutView != null)
      {
        // do something
      }
    }
    UnSelect elements on the LayoutView
    {
      //Unselect one element.
      var elementToUnSelectInView = layout.FindElements(new List<string>() { "MyPoint" }).FirstOrDefault();
      layoutView.UnSelectElement(elementToUnSelectInView);
      //Unselect multiple elements.
      var elementsToUnSelectInView = layout.FindElements(new List<string>() { "Point 1", "Line 3", "Text 1" });
      layoutView.UnSelectElements(elementsToUnSelectInView);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also