ArcObjects Library Reference

Get SceneViewer from SceneControl Snippet

Obtain an ISceneViewer interface from an AxSceneControl.

[C#]
/// <summary>
/// Obtain an ISceneViewer interface from an AxSceneControl.
/// </summary>
/// <param name="sceneControl">An AxSceneControl</param>
/// <returns>An ISceneViewer interface.</returns>
/// <remarks>An ISceneViewer interface can also be obtained by IGlobeDisplay.ActiveViewer</remarks>
public ESRI.ArcGIS.Analyst3D.ISceneViewer GetSceneViewerFromSceneControl(ESRI.ArcGIS.Controls.SceneControl sceneControl)
{

  ESRI.ArcGIS.Analyst3D.ISceneViewer sceneViewer = sceneControl.SceneViewer;

  return sceneViewer;

}
[Visual Basic .NET]
''' <summary>
''' Obtain an ISceneViewer interface from an AxSceneControl.
''' </summary>
''' <param name="sceneControl">An AxSceneControl</param>
''' <returns>An ISceneViewer interface.</returns>
''' <remarks>An ISceneViewer interface can also be obtained by IGlobeDisplay.ActiveViewer</remarks>
Public Function GetSceneViewerFromSceneControl(ByVal sceneControl As ESRI.ArcGIS.Controls.SceneControl) As ESRI.ArcGIS.Analyst3D.ISceneViewer

  Dim sceneViewer As ESRI.ArcGIS.Analyst3D.ISceneViewer = sceneControl.SceneViewer

  Return sceneViewer

End Function


Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.3DAnalyst
  • ESRI.ArcGIS.Controls
  • ESRI.ArcGIS.System
  • System.Windows.Forms