Private Sub Form_Load()
Dim objApp As SolidEdgeFrameWork.Application
Dim objDoc As solidedgedraft.DraftDocument
Dim objSheet As solidedgedraft.Sheet
Dim objDatumPoints As SolidEdgeFrameworkSupport.DatumPoints
Dim objdatumPoint As SolidEdgeFrameworkSupport.DatumPoint
Dim objCircle As SolidEdgeFrameworkSupport.Circle2d
Dim objCenterObj As SolidEdgeFrameworkSupport.Circle2d
Dim dblX As Double, dblY As Double, dblZ As Double
Dim bKeyPoint As Boolean
' 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.DraftDocument")
objApp.Visible = True
Else
Set objDoc = objApp.ActiveDocument
End If
'Get the Active Sheet object
Set objSheet = objDoc.ActiveSheet
'create a collection of datumpoint.
Set objDatumPoints = objSheet.DatumPoints
'draw a circle
Set objCircle = objSheet.Circles2d.AddByCenterRadius(x:=0.2, _
y:=0.2, Radius:=0.05)
'add a datumpoint to collection
Set objdatumPoint = objDatumPoints.AddByElement(terminatorobject:= _
objCircle, x1:=0.2, y1:=0.2, z1:=0, keypoint1:=True)
'call getelement
Call objdatumPoint.GetElement(CenterObj:=objCenterObj, x:=dblX, _
y:=dblY, z:=dblZ, Keypoint:=bKeyPoint)
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objSheet = Nothing
Set objDatumPoints = Nothing
Set objdatumPoint = Nothing
Set objCircle = Nothing
Set objCenterObj = Nothing
End Sub