API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateCurveSegment method
Creates a curve segment (curve object) on a layer
Syntax:
Function CreateCurveSegment(ByVal StartX As Double, ByVal StartY As Double, ByVal EndX As Double, ByVal EndY As Double, Optional ByVal StartingControlPointLength As Double = -1, Optional ByVal StartingControlPointAngle As Double = 0, Optional ByVal EndingControlPointLength As Double = -1, Optional ByVal EndingControlPointAngle As Double = 0) As Shape
Parameters:
Name Type Description
StartX
Double
StartY
Double
EndX
Double
EndY
Double
StartingControlPointLength
Double
Specifies, in document units, the length of the starting control point.
StartingControlPointAngle
Double
Specifies the angle, measured in degrees, of the starting control.
EndingControlPointLength
Double
Specifies, in document units, the length of the ending control point.
EndingControlPointAngle
Double
Specifies the angle, measured in degrees, of the ending control point.
Remarks:
The CreateCurveSegment method creates a single curve at a specified location on a layer.
Examples:
The following VBA example creates a curve segment on the active layer. The starting point of the curve is (3, 3), and the ending point is (6, 6). The length of the starting and ending control points is 5, and the starting and ending angles of the control points are 45°.
Sub CurveCreate()
ActiveLayer.CreateCurveSegment(3, 3, 6, 6, 5, 45, 5, 45) 
End Sub