Solid Edge Geometry Type Library
GetSphereData Method
Returns the coordinates of the point that is the center of the referenced sphere.
Returns the radius of the referenced sphere.
Description
Returns the surface geometry data on the referenced Sphere object.
Syntax
Visual Basic
Public Sub GetSphereData( _
   ByRef CenterPoint() As Double, _
   ByRef Radius As Double _
) 
Parameters
CenterPoint
Returns the coordinates of the point that is the center of the referenced sphere.
Radius
Returns the radius of the referenced sphere.
Example
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
See Also

Sphere Object  | Sphere Members

Send comments on this topic.