ArcGIS Pro 2.9 API Reference Guide
SetViewingModeAsync Method
Example 

ArcGIS.Desktop.Mapping Namespace > MapView Class : SetViewingModeAsync Method
Set the perspective of the map view..
Syntax
public Task SetViewingModeAsync( 
   MapViewingMode viewingMode
)
Public Function SetViewingModeAsync( _
   ByVal viewingMode As MapViewingMode _
) As Task

Parameters

viewingMode
Exceptions
ExceptionDescription
Map can only be set for 2D views and SceneLocal and SceneGlobal can only be set for 3D views.
Remarks
A map view can be used to show maps which display 2D data or scenes which display 3D data. This method can be used to switch between Local and Global for 3D.
Example
Change the active map view's viewing mode to SceneLocal.
public void SetViewingModeToSceneLocal()
{
  //Get the active map view.
  var mapView = MapView.Active;
  if (mapView == null)
    return;

  //Check if the view can be set to SceneLocal and if it can set it.
  if (mapView.CanSetViewingMode(ArcGIS.Core.CIM.MapViewingMode.SceneLocal))
    mapView.SetViewingModeAsync(ArcGIS.Core.CIM.MapViewingMode.SceneLocal);
}
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

MapView Class
MapView Members