API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateLineSegment method
Creates a line segment (curve object) on a layer
Syntax:
Function CreateLineSegment(ByVal StartX As Double, ByVal StartY As Double, ByVal EndX As Double, ByVal EndY As Double) As Shape
Parameters:
Name Type Description
StartX
Double
StartY
Double
EndX
Double
EndY
Double
Remarks:
The CreateLineSegment method creates a curve comprised of a single line segment at a specified location on a layer.
Examples:
The following VBA example creates a line segment on the active layer.
Sub Test()
ActiveLayer.CreateLineSegment 1, 2, 5, 6 
End Sub