ビューの設定ダイアログの設定

Public Sub SetProperties()

    Dim pSxDocument As ISxDocument
    Set pSxDocument = ThisDocument
    
    Dim pScene As IScene
    Set pScene = pSxDocument.Scene
    
    Dim pSceneGraph As ISceneGraph
    Set pSceneGraph = pScene.SceneGraph
    
    Dim p3DViewer As I3DViewer
    Set p3DViewer = pSceneGraph.ActiveViewer
    
    Dim pCamera As ICamera3
    Set pCamera = p3DViewer.Camera
    
    '位置
    '目標点
    Dim pObserverPoint As IPoint
    Set pObserverPoint = pCamera.Observer
    
    Debug.Print pObserverPoint.X, pObserverPoint.Y, pObserverPoint.Z
    
    pObserverPoint.X = 140
    pObserverPoint.Y = 40
    pObserverPoint.Z = 2
    
    pCamera.Observer = pObserverPoint
    
    '観測点
    Dim pTargetPoint As IPoint
    Set pTargetPoint = pCamera.Target
    
    Debug.Print pTargetPoint.X, pTargetPoint.Y, pTargetPoint.Z
    
    '目標点までの距離
    Debug.Print pCamera.ViewingDistance
    
    '表示特性
    pCamera.DisplayType = esriNonstereoDisplay
    pCamera.ProjectionType = esriPerspectiveProjection  '三次元表示
    'pCamera.ProjectionType = esriOrthoProjection        '二次元表示
    'pCamera.DisplayType = esriStereoDisplay             'ステレオ表示
    
    'ロール角
    pCamera.RollAngle = 0
    
    
    'ピッチ
    pCamera.Inclination = 0
    
    '視野角
    pCamera.ViewFieldAngle = 55
    
    'リフレッシュ
    pSceneGraph.ActiveViewer.Redraw True

End Sub