Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgepart.PartDocument
Dim objFace As Object
Dim ObjSphere As Object
Dim objSphereParent As Object
' 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
'Create base feature
If CreateModel(objDoc) <> "" Then
MsgBox "Error creating the model"
Exit Sub
End If
'Get a handle to spherical face object
Set objFace = objDoc.Models(1).Body.Faces(FaceType:=igQuerySphere)
'Get handle to the Sphere object
Set ObjSphere = objFace(1).Geometry
'Get the handle to Parent object from Sphere
Set objSphereParent = ObjSphere.Parent
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objFace = Nothing
Set ObjSphere = Nothing
Set objSphereParent = Nothing
End Sub