This routine when called will return the ICamera interface of the current scene's scenegraph viewer.
How to use
- Paste the code into VBA
- Run the function from a calling procedure which sets the return value of GetSceneCamera to an ICamera interface variable.
Public Function GetSceneCamera() As ICamera
' Returns the ICamera interface of the current scene
Dim pSG As ISceneGraph
Dim pScene As IScene
Dim pSxDoc As ISxDocument
Dim pViewer As ISceneViewer
Set pSxDoc = Application.Document
Set pScene = pSxDoc.Scene
Set pSG = pScene.SceneGraph
Set pViewer = pSG.ActiveViewer
Set GetSceneCamera = pViewer.Camera
End Function