Private Sub Form_Load()
Dim objApp As SolidEdgeframework.Application
Dim objDoc As SolidEdgepart.PartDocument
Dim objPBCParent As solidedgegeometry.EdgeUse
Dim objEdgeUse As solidedgegeometry.EdgeUse
Dim objPBCurve As solidedgegeometry.ParamBSplineCurve
Const TESTFILE = "T:\vbtests\testcases\freeform.par"
' 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
Call objDoc.Close
' opening the test case file
Set objDoc = objApp.Documents.Open(TESTFILE)
' getting an EdgeUse object from the test case
Set objEdgeUse = objDoc.Models(1).Body.Shells(1).Faces(1).Loops(1).EdgeUses(1)
' getting the ParamBSplineCurve object
Set objPBCurve = objEdgeUse.Geometry
' getting the Parent object of the ParamBSplineCurve object
Set objPBCParent = objPBCurve.Parent
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objPBCParent = Nothing
Set objEdgeUse = Nothing
Set objPBCurve = Nothing
End Sub