Solid Edge Geometry Type Library
GetCenterPoint Method
Returns the coordinates of the point that is the center of the referenced object.
Description
Returns the point that is the center of the referenced object.
Syntax
Visual Basic
Public Sub GetCenterPoint( _
   ByRef CenterPoint() As Double _
) 
Parameters
CenterPoint
Returns the coordinates of the point that is the center of the referenced object.
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
    ' 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 CenterPoint of the Sphere
    ObjSphere.GetCenterPoint CenterPoint:=dblCenterPoint
    ' 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.