Imports System.Runtime.InteropServices
Public Class frm2DDisplayProformance
Private Sub btn2DDisplayProformance_Click(sender As System.Object, e As System.EventArgs) Handles btn2DDisplayProformance.Click
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDraftDoc As SolidEdgeDraft.DraftDocument = Nothing
Dim objSheetWin As SolidEdgeDraft.SheetWindow = Nothing
Dim objType As Type = Nothing
Try
' Create/get the application with specific settings
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
If objApplication Is Nothing Then
' Get the type from the Solid Edge ProgID
objType = Type.GetTypeFromProgID("SolidEdge.Application")
' Start Solid Edge
objApplication = Activator.CreateInstance(objType)
' Make Solid Edge visible
objApplication.Visible = True
End If
' Get the reference to the open document
objDraftDoc = objApplication.Documents.Add("SolidEdge.Draftdocument")
objSheetWin = objDraftDoc.Windows
'Sets up the view for fast display
Call objSheetWin.BeginSheetViewDynamics()
Call objSheetWin.ZoomArea(objSheetWin.Left, objSheetWin.Top, objSheetWin.Width, objSheetWin.Height)
Call objSheetWin.ZoomArea(objSheetWin.Left + 10, objSheetWin.Top + 10, objSheetWin.Width - 10, objSheetWin.Height - 10)
Call objSheetWin.ZoomArea(objSheetWin.Left + 20, objSheetWin.Top + 20, objSheetWin.Width - 20, objSheetWin.Height - 20)
Call objSheetWin.ZoomArea(objSheetWin.Left + 30, objSheetWin.Top + 30, objSheetWin.Width - 30, objSheetWin.Height - 30)
Call objSheetWin.ZoomArea(objSheetWin.Left + 40, objSheetWin.Top + 40, objSheetWin.Width - 40, objSheetWin.Height - 40)
Call objSheetWin.ZoomArea(objSheetWin.Left + 50, objSheetWin.Top + 50, objSheetWin.Width - 50, objSheetWin.Height - 50)
'Ends the fast display dynamics
Call objSheetWin.EndSheetViewDynamics()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class