This routine when called will return the IGlobeCamera interface of the current globe's sceneviewer.
How to use
- Paste the code into VBA.
- Run the function from a calling procedure which sets the return value of GetGlobeCamera to an IGlobeCamera interface variable.
Public Function GetGlobeCamera() As IGlobeCamera
' Returns the IGlobeCamera interface of the current globe
Dim pGMxDoc As IGMxDocument
Set pGMxDoc = Application.Document
Dim pScene As IScene
Set pScene = pGMxDoc.Scene
Dim pGlobe As IGlobe
Set pGlobe = pScene
Dim pGlobeDisp As IGlobeDisplay
Set pGlobeDisp = pGlobe.GlobeDisplay
Dim pViewer As ISceneViewer
Set pViewer = pGlobeDisp.ActiveViewer
Set GetGlobeCamera = pViewer.Camera
End Function