Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgePart.PartDocument
Dim objDocuments As SolidEdgeFramework.Documents
Dim strFileName As String
Dim strTemplate As String
' Report errors
Const PI = 3.14159265358979
' Create/get the application with specific settings
On Error Resume Next
Set objApp = GetObject(, "SolidEdge.Application")
If Err Then
Err.Clear
Set objApp = CreateObject("SolidEdge.Application")
Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
objApp.Visible = True
Else
Set objDoc = objApp.ActiveDocument
End If
objDoc.Close
'Get the Documents collection
Set objDocuments = objApp.Documents
strFileName = "T:\vbtests\TestCases\ems032_0.x_t"
strTemplate = "T:\vbtests\TestCases\normeng.par"
'Open a non-native SoldEdge file with specified template
Set objDoc = objDocuments.OpenWithTemplate(Filename:=strFileName, TEMPLATE:=strTemplate)
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objDocuments = Nothing
End Sub