Library Reference  

3DAnalystUI 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


The 3DAnalystUI library provides user interfaces to support export objects contained in the 3DAnalyst library. The 3DAnalyst Extension object is implemented by this library as well.

Developers extend this library when they create UI functions for corresponding components they have created in the 3DAnalyst library.


The objects that implement this functionality are grouped into a number of library subsystems. These library subsystems are:

DDDEnvironment

DDDEnvironment is the 3D Analyst extension object. It's used to check and set 3D Analyst license properties from custom ArcGIS desktop tools and commands. These tools and commands can check for the existence of the extension and see if it's licensed before offering functionality dependent on the extension. The object is a singleton and is non-cocreatable. It must be acquired through an ExtensionManager object. The following two functions show how to turn on and off 3D Analyst license. Make sure that the esriSystem assembly, where the ExtensionManager coclass resides, is referenced.

[Visual Basic 6.0]
Function TurnOn3DLicense() As Boolean
On Error GoTo eh
  Dim objID As New esriSystem.UID: objID = "esri3DAnalystUI.DDDEnvironment"

  Dim pExtManager As IExtensionManagerAdmin: Set pExtManager = New ExtensionManager
  pExtManager.AddExtension objID, 0   'add the extension first
  Dim pEM As IExtensionManager: Set pEM = pExtManager 'QI
  Dim pEC As IExtensionConfig: Set pEC = pEM.FindExtension(objID) 'QI
  If pEC Is Nothing Then  'couldn't find the extension
    MsgBox "Can't find the extension!", vbExclamation
    TurnOn3DLicense = False
    Exit Function
  Else
    pEC.State = esriESEnabled
    TurnOn3DLicense = (pEC.State = esriESEnabled)
  End If

Exit Function
eh:
  MsgBox Err.Number & ": " & Err.Description, vbExclamation, "TurnOn3DLicense()"
End Function

Function TurnOff3DLicense() As Boolean
On Error GoTo eh
  Dim objID As New esriSystem.UID: objID = "esri3DAnalystUI.DDDEnvironment"

  Dim pEM As IExtensionManager: Set pEM = New ExtensionManager
  Dim pExt As IExtension: Set pExt = pEM.FindExtension(objID)
  If pExt Is Nothing Then   'couldn't find the extension
    MsgBox "Can't find the extension!", vbExclamation
    TurnOff3DLicense = False
  Else
    Dim pEC As IExtensionConfig: Set pEC = pExt 'QI
    pEC.State = esriESDisabled
    TurnOff3DLicense = (pEC.State = esriESDisabled)
  End If

Exit Function
eh:
  MsgBox Err.Number & ": " & Err.Description, vbExclamation, "TurnOff3DLicense()"
End Function

 

SceneExport

3D Scenes can be exported to a variety of image formats as static snapshots or to VRML files. VRML is an industry standard 3-D graphics format. The SceneExport2dDialog or SceneExportFile2dDialog (a newer version of SceneExport2dDialog in essence) is a user interface (UI) for creating image snapshots. The SceneExport3dDialog, supported in ArcScene only, is a user interface for exporting to VRML. The following ArcScene VBA code shows how to pop up scene export dialogs. Users can subsequently change the parameter settings on the dialog once it's up. The code is similar in ArcGlobe (without the VRML part). Note that the SceneExportFile2dDialog has more UI options and is designed to replace SceneExport2dDialog. It's the same dialog as that in ArcScene | File | Export Scene | 2D... or that in ArcGlobe | Export Globe... .

[Visual Basic 6.0]
  Dim pDoc As ISxDocument: Set pDoc = ThisDocument
  Dim pScene As IScene: Set pScene = pDoc.Scene

  Dim pEnv As IEnvelope: Set pEnv = New Envelope
  pEnv.PutCoords 100#, 100#, 300#, 200#

  'pop up the 2D scene export dialog:
  Dim p2D As ISceneExportFile2dDialog: Set p2D = New SceneExportFile2dDialog
  p2D.DoModal pEnv, 150

  'pop up the 3D scene export dialog:
  Dim p3D As ISceneExport3dDialog: Set p3D = New SceneExport3dDialog
  p3D.DoModal