Library Reference  

ArcScene Library Overview


Supported with: ArcGIS Desktop with 3D Analyst

Library dependencies: System, SystemUI, Geometry, Display, Server, Output, GeoDatabase, GISClient, DataSourcesFile, DataSourcesGDB, DataSourcesOleDB, DataSourcesRaster, GeoDatabaseDistributed, Carto, NetworkAnalyst, Schematic, Location, NetworkAnalysis, Controls, GeoAnalyst, 3DAnalyst, GlobeCore, SpatialAnalyst, Framework, GeoDatabaseUI, DisplayUI, OutputUI, Catalog, CatalogUI, CartoUI, DataSourcesRasterUI, ArcCatalogUI, ArcCatalog, ArcMapUI, Editor, LocationUI, ArcMap, EditorExt, SchematicUI, GeoDatabaseDistributedUI, Geoprocessing, GeoprocessingUI, NetworkAnalystUI, OutputExtensions, OutputExtensionsUI, SpatialAnalystUI, 3DAnalystUI


The ArcScene library contains the ArcScene application, along with its associated user interface components, commands, and tools. The ArcScene Application and SxDocument objects are both defined and implemented by this library. Developers can use the Application object when customizing the ArcScene application or working with one of ArcScene's extensions.

Developers extend this library by creating commands, tools and extensions for use within the ArcScene application.


The objects in the ArcScene object library can be grouped into the following library subsystems:


ArcScene Application


Similar to other ArcGIS desktop applications such as ArcMap, ArcCatalog, and ArcGlobe, Application is the core object that represents the ArcScene desktop application. When you start ArcScene, the Application object is created and then, in turn, instantiates all the objects it manages. Through this coclass you can access properties and methods for the application and navigate to other elements, such as the document, window handle, and status bar.

The following VBA code describes how to get a handle to the application object directly:

[Visual Basic for Applications]
  Dim pApp as IApplication
  Set pApp = Application

If you're implementing commands and tools in Visual Basic DLLs the classes get a hook to the application object when they're instantiated:

' Declare the application variable at the module level
  Private m_pApp as IApplication

  Private Sub OnCreate(hook as object)
    Dim m_pApp as IApplication
    set m_pApp = hook
  End Sub

Also, as shown in the VBA macro below, you can create a new AppRef object to get a reference to the current application.

[Visual Basic for Applications]
Public Sub GetCurrentApplication()

  Dim pApp As IApplication
  Set pApp = New AppRef

  Dim pSxDoc As ISxDocument

  If TypeOf pApp.Document Is ISxDocument Then
    Set pSxDoc = pApp.Document
    MsgBox "The current application is ArcScene"
  End If
End Sub

Once you have a handle on the application you have access to everything contained within it. The application is composed of a SxDocument. The document is composed of a Scene, as shown in the diagram below.



The scene has a SceneGraph in the 3DAnalyst library that references one or more viewers, each of which has a Camera. If, for example, you want access to a viewer's camera you drill down through each of the objects in the diagram to gain access to it.


ArcScene Document

The ArcScene document is called SxDocument. Each running instance of ArcScene works with a current scene document, which is represented by SxDocument. There is one SxDocument per session of ArcScene. The SxDocument is cocreatable and the ArcScene application automatically creates this object when the application first starts.

Contents views in ArcScene documents

Contents views are tabs in the ArcScene table of contents. Similar to ArcMap, ArcScene ships with two contents views for displaying layers: the Display view and Source view. The Display tab is the TOCSxDisplayView object and the Source tab is the TOCSxSourceView object. Developers can add new contents view by creating their own custom object that implements the IContentsView interface. All contents views are managed by the SxDocument object and must be registered in the 'ESRI Contents Views' component category. The registered contents views are automatically created by the SxDocument object when it is first created. However, only one contents view can be active at a time. ISxDocument::CurrentContentsView can be used to set the current contents view and to get a reference to the current contents view.

Filtering ArcScene documents

When browsing for ArcScene documents (*.sxd files) GxFilterScenes, which maintains the document filter used by ArcScene, determines which documents can be opened up in ArcScene.