API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateCurveSegment2 method
Creates a curve segment by using control point coordinates
Syntax:
Function CreateCurveSegment2(ByVal x1 As Double, ByVal y1 As Double, ByVal StartingControlPointX As Double, ByVal StartingControlPointY As Double, ByVal EndingControlPointX As Double, ByVal EndingControlPointY As Double, ByVal x2 As Double, ByVal y2 As Double) As Shape
Parameters:
Name Type Description
x1
Double
y1
Double
StartingControlPointX
Double
StartingControlPointY
Double
EndingControlPointX
Double
EndingControlPointY
Double
x2
Double
y2
Double
Remarks:
The CreateCurveSegment2 method uses specified control-point coordinates to create a curve segment at a specified location on a layer.
Examples:
The following VBA example creates a curve and adds text along the curve.
Sub Test()
Dim sText As Shape, sPath As Shape
Set sText = ActiveLayer.CreateArtisticText(0, 0, "Some Text")
Set sPath = ActiveLayer.CreateCurveSegment2(0.6, 4.5, 0, 3, 5.2, 8.2, 5.3, 7)
sText.Text.FitToPath sPath
sText.Effects(1).TextOnPath.Placement = cdrCenterPlacement 
End Sub