ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / ViewingMode Property
Example

In This Topic
    ViewingMode Property (MapView)
    In This Topic
    Gets the perspective of the view.
    Syntax
    Public ReadOnly Property ViewingMode As MapViewingMode
    public MapViewingMode ViewingMode {get;}
    Remarks
    This property is used to determine whether the view is displaying a 2D map or 3D scene. A map view can be used to show maps which display 2D data or scenes which display 3D data. For a 3D view SceneLocal and SceneGlobal are valid view modes for the scene.
    Example
    Test if the view is 3D
    {
      //Determine whether the viewing mode is SceneLocal or SceneGlobal
      var result = mapView.ViewingMode == MapViewingMode.SceneLocal ||
                   mapView.ViewingMode == MapViewingMode.SceneGlobal;
    
      // Use the result variable as needed
    }
    Check if a Voxel Layer can be created
    {
      //Map must be a local scene
      bool canCreateVoxel = (MapView.Active.ViewingMode == MapViewingMode.SceneLocal);
    
      if (canCreateVoxel)
      {
        //TODO - use the voxel api methods
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also