Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgepart.PartDocument
Dim objFace As Object
Dim ObjSphere As Object
Dim dblCenterPoint() As Double
Dim dblRadius As Double
' 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 Sphere Data i.e., CenterPoint co-ordinates and Radius
ObjSphere.GetSphereData CenterPoint:=dblCenterPoint, Radius:=dblRadius
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objFace = Nothing
Set ObjSphere = Nothing
End Sub