API Documentation > CorelDRAW > 2025-v26 > Curve > IVGCurve
Curve.CreateSubPath method
Adds (or replaces) an empty subpath at the end of the curve
Syntax:
Function CreateSubPath(ByVal x As Double, ByVal y As Double) As SubPath
Parameters:
Name Type Description
x
Double
y
Double
Remarks:
The CreateSubPath method creates a subpath for a curve. The CreateSubPath method requires x- and y-coordinates to represent the first node in the subpath.
Examples:
The following VBA example creates a curve with two line segments and three curve segments within the subpath.
Sub Test()
Dim s As Shape
Dim sp As SubPath
Dim crv As Curve
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 7, 4
sp.AppendLineSegment 9, 0
sp.Nodes(2).Type = cdrSmoothNode
sp.Nodes(3).Type = cdrSmoothNode
sp.Nodes(4).Type = cdrSmoothNode
sp.Nodes(5).Type = cdrSmoothNode
Set s = ActiveLayer.CreateCurve(crv) 
End Sub