Solid Edge FrameworkSupport Type Library
AddByStartEnd Method
Specifies the object at which the centerline is to start.
Specifies the coordinates of the locate point for the first start object. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
Specifies the coordinates of the locate point for the first start object. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
Specifies the coordinates of the locate point for the first start object. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
Specifies whether the object or a key point of the object is to be considered for measuring. If KeyPoint1 is True, the element is selected for the centerline's start point; if KeyPoint1 is False, the nearest key point is selected.
Specifies the coordinates of the locate point of the end object. This point is used as a proximity point while calculating the key point. The z2 argument applies only to 3-D objects.
Specifies the coordinates of the locate point of the end object. This point is used as a proximity point while calculating the key point. The z2 argument applies only to 3-D objects.
Specifies the coordinates of the locate point of the end object. This point is used as a proximity point while calculating the key point. The z2 argument applies only to 3-D objects.
Specifies whether the object or a key point of the object is to be considered for measuring. If KeyPoint2 is True, the element is selected for the end point of the centerline; if KeyPoint2 is False, the nearest key point is selected.
Description
Creates a CenterLine object from a point that starts at a specified ojbect and terminates at another specified object.
Syntax
Visual Basic
Public Function AddByStartEnd( _
   ByVal StartObject As Object, _
   ByVal x1 As Double, _
   ByVal y1 As Double, _
   ByVal z1 As Double, _
   ByVal keyPoint1 As Boolean, _
   ByVal EndObject As Object, _
   ByVal x2 As Double, _
   ByVal y2 As Double, _
   ByVal z2 As Double, _
   ByVal keyPoint2 As Boolean _
) As CenterLine
Parameters
StartObject
Specifies the object at which the centerline is to start.
x1
Specifies the coordinates of the locate point for the first start object. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
y1
Specifies the coordinates of the locate point for the first start object. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
z1
Specifies the coordinates of the locate point for the first start object. This point is used as a proximity point while calculating the key point. The z1 argument applies only to 3-D objects.
keyPoint1
Specifies whether the object or a key point of the object is to be considered for measuring. If KeyPoint1 is True, the element is selected for the centerline's start point; if KeyPoint1 is False, the nearest key point is selected.
EndObject
x2
Specifies the coordinates of the locate point of the end object. This point is used as a proximity point while calculating the key point. The z2 argument applies only to 3-D objects.
y2
Specifies the coordinates of the locate point of the end object. This point is used as a proximity point while calculating the key point. The z2 argument applies only to 3-D objects.
z2
Specifies the coordinates of the locate point of the end object. This point is used as a proximity point while calculating the key point. The z2 argument applies only to 3-D objects.
keyPoint2
Specifies whether the object or a key point of the object is to be considered for measuring. If KeyPoint2 is True, the element is selected for the end point of the centerline; if KeyPoint2 is False, the nearest key point is selected.
Remarks
The start and end points can be an element or a key point on that element.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgeDraft.DraftDocument
    Dim objCenterLines As SolidEdgeFrameworkSupport.CenterLines
    Dim objCircle1 As SolidEdgeFrameworkSupport.Circle2d
    Dim objCircle2 As SolidEdgeFrameworkSupport.Circle2d
    ' 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
    ' drawing a circle on the active sheet
    Set objCircle1 = objDoc.ActiveSheet.Circles2d.AddByCenterRadius(x:=0.25, y:=0.25, Radius:=0.05)
    Set objCircle2 = objDoc.ActiveSheet.Circles2d.AddByCenterRadius(x:=0.5, y:=0.1, Radius:=0.03)
    ' getting the CenterLines object
    Set objCenterLines = objDoc.ActiveSheet.CenterLines
    ' drawing a center line on the active sheet using the nearest KeyPoints on the Start & End objects
    Call objCenterLines.AddByStartEnd(StartObject:=objCircle1, x1:=0.25, y1:=0.5, z1:=0, keyPoint1:=False, _
                                      EndObject:=objCircle2, x2:=0.1, y2:=0.1, z2:=0, Keypoint2:=False)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objCenterLines = Nothing
    Set objCircle1 = Nothing
    Set objCircle2 = Nothing
End Sub
See Also

CenterLines Collection  | CenterLines Members

Send comments on this topic.