Solid Edge Framework Type Library
SetCamera Method
Specifies the x coordinate of the camera eye.
Specifies the y coordinate of the camera eye.
Specifies the z coordinate of the camera eye.
Specifies the x coordinate of the target.
Specifies the y coordinate of the target.
Specifies the z coordinate of the target.
Specifies the x coordinate of the (normalize) up vector.
Specifies the y coordinate of the (normalize) up vector.
Specifies the z coordinate of the (normalize) up vector.
Sets the View Perspective.
Specifies the orthographic scale for non-perspective views or the field of view angle for perspective views.
Description
Specifies the settings of the camera.
Syntax
Visual Basic
Public Sub SetCamera( _
   ByVal EyeX As Double, _
   ByVal EyeY As Double, _
   ByVal EyeZ As Double, _
   ByVal TargetX As Double, _
   ByVal TargetY As Double, _
   ByVal TargetZ As Double, _
   ByVal UpX As Double, _
   ByVal UpY As Double, _
   ByVal UpZ As Double, _
   ByVal Perspective As Boolean, _
   ByVal ScaleOrAngle As Double _
) 
Parameters
EyeX
Specifies the x coordinate of the camera eye.
EyeY
Specifies the y coordinate of the camera eye.
EyeZ
Specifies the z coordinate of the camera eye.
TargetX
Specifies the x coordinate of the target.
TargetY
Specifies the y coordinate of the target.
TargetZ
Specifies the z coordinate of the target.
UpX
Specifies the x coordinate of the (normalize) up vector.
UpY
Specifies the y coordinate of the (normalize) up vector.
UpZ
Specifies the z coordinate of the (normalize) up vector.
Perspective
Sets the View Perspective.
ScaleOrAngle
Specifies the orthographic scale for non-perspective views or the field of view angle for perspective views.
Example
Imports System.IO
Imports System.Runtime.InteropServices
Public Class Form1
    Private Sub SetCameraIsoView_Click(sender As Object, e As EventArgs) Handles SetCameraIsoView.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objAssemblyDocument As SolidEdgeAssembly.AssemblyDocument = Nothing
        Dim SEInstallDir As DirectoryInfo
        Dim objView As SolidEdgeFramework.View = Nothing
        Dim objCurWindow As SolidEdgeFramework.Window

        Try
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            SEInstallDir = GetTrainingFolder()
            objAssemblyDocument = objApplication.Documents.Open(SEInstallDir.FullName + "\carrier.asm")
            objCurWindow = objApplication.ActiveWindow
            objView = objCurWindow.View
            objView.SetCamera(EyeX:=0.2, EyeY:=-0.13, EyeZ:=0.25, TargetX:=0.01, TargetY:=0.07, TargetZ:=0.05, UpX:=-0.58, UpY:=0.58, UpZ:=0.58, Perspective:=False, ScaleOrAngle:=1786.6)

        Catch ex As Exception
            MsgBox(ex.ToString)
            Clipboard.SetText(ex.ToString)
        End Try

    End Sub

    Private Sub SetCameraTopView_Click(sender As Object, e As EventArgs) Handles SetCameraTopView.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objView As SolidEdgeFramework.View = Nothing
        Dim objCurWindow As SolidEdgeFramework.Window

        Try
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            objCurWindow = objApplication.ActiveWindow
            objView = objCurWindow.View
            objView.SetCamera(EyeX:=0.01, EyeY:=0.07, EyeZ:=0.27, TargetX:=0.01, TargetY:=0.07, TargetZ:=0.05, UpX:=0.0, UpY:=1.0, UpZ:=0.0, Perspective:=False, ScaleOrAngle:=4123.0)
        Catch ex As Exception
            MsgBox(ex.ToString)
            Clipboard.SetText(ex.ToString)
        End Try

    End Sub

    Function GetTrainingFolder() As DirectoryInfo
        Dim objInstallData As SEInstallDataLib.SEInstallData = Nothing
        Dim objInstallFolder As DirectoryInfo = Nothing
        Dim objTrainingFolder As DirectoryInfo = Nothing

        Try
            objInstallData = New SEInstallDataLib.SEInstallData
            objInstallFolder = New DirectoryInfo(objInstallData.GetInstalledPath())
            objTrainingFolder = New DirectoryInfo(Path.Combine(objInstallFolder.Parent.FullName, "Training"))
        Catch
        Finally
            If Not (objInstallData Is Nothing) Then
                Marshal.FinalReleaseComObject(objInstallData)
                objInstallData = Nothing
            End If
        End Try

        Return objTrainingFolder
    End Function
End Class
See Also

View Object  | View Members