| 
       | 
        
       | Object Model Reference : Classes : S : Segment : Methods : Segment.SetEndingControlPointPosition  | 
      
Sub SetEndingControlPointPosition(PositionX As Double, PositionY As Double)
Member of Segment
The SetEndingControlPointPosition method sets the position of the ending control point for a segment.
|   
Parameter
 
 | 
      
Description
 
 | 
|   
PositionX
 
 | 
      
Specifies the horizontal position
 
 | 
|   
PositionY
 
 | 
      
Specifies the vertical position
 
 | 
The following VBA example creates a curve, and it sets the ending control point of the last segment to the same position as the ending control point of the second segment.
Sub Test()  | 
 Dim s As Shape, s2 As Shape  | 
 Dim sp As SubPath  | 
 Dim crv As Curve, crv2 As Curve  | 
 Dim seg As Segment, seg2 As Segment  | 
 Dim x As Double, y As Double  | 
 Set crv = CreateCurve(ActiveDocument)  | 
 ActiveDocument.ReferencePoint = cdrBottomLeft  | 
 Set sp = crv.CreateSubPath(1, 1)  | 
 sp.AppendLineSegment 1, 1  | 
 sp.AppendCurveSegment 3, 3  | 
 sp.AppendCurveSegment 5, 1  | 
 sp.AppendCurveSegment 6, 4  | 
 sp.Nodes(2).Type = cdrSmoothNode  | 
 sp.Nodes(3).Type = cdrSmoothNode  | 
 Set s = ActiveLayer.CreateCurve(crv)  | 
 Set seg = ActiveShape.Curve.Segments(2)  | 
 seg.GetEndingControlPointPosition x, y  | 
 Set seg2 = ActiveShape.Curve.Segments(ActiveShape.Curve.Segments.Count)  | 
 seg2.SetEndingControlPointPosition x, y  | 
End Sub  | 
| 
       | 
        
       | 
		      
		          
		             | 
      
Copyright 2013 Corel Corporation. All rights reserved.