Private Sub Form_Load()
Dim objApp As SolidEdgeFrameWork.Application
Dim objDoc As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objModelLink As SolidEdgeDraft.ModelLink
Dim objAttribSets As Object
' Local variables to be declared here
Const TESTFILE = "T:\vbtests\testcases\chead.par"
' 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.DraftDocument")
objApp.Visible = True
Else
Set objDoc = objApp.ActiveDocument
End If
On Error GoTo 0
'Get the Active Sheet object
Set objSheet = objDoc.ActiveSheet
'Add a model to the Document
Set objModelLink = objDoc.ModelLinks.Add(Filename:=TESTFILE)
' Get the AttributeSets property
Set objAttribSets = objModelLink.AttributeSets
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objSheet = Nothing
Set objAttribSets = Nothing
End Sub