Private Sub Form_Load()
    Dim objApp As SolidEdgeFrameWork.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objProfile As SolidEdgePart.Profile
    Dim objGeometry(10) As Object
    ' Local variables to be declared here
    Const TESTFILE = "T:\vbtests\testcases\OrderedGeometry.par"
    Dim lngNumGeometry As Long
    ' 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
    On Error GoTo 0
    'Close the existing Document
    Call objDoc.Close(Savechanges:=False)
    'Open the test case
    Set objDoc = objApp.Documents.Open(Filename:=TESTFILE)
    'Get the Profile of the ExtrudedProtrusion1
    Set objProfile = objDoc.Models(1).ExtrudedProtrusions(1).Profile
    'Get the profile geometry with the help of OrderedGeometry method
    Call objProfile.OrderedGeometry(numelements:=lngNumGeometry, Elements:=objGeometry)
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objProfile = Nothing
    Dim i As Integer
    For i = 0 To UBound(objGeometry)
        Set objGeometry(i) = Nothing
    Next
End Sub