API Documentation > CorelDRAW > 2025-v26 > Segment > IVGSegment
Segment.Next method
Gets the segment following this one
Syntax:
Function Next() As Segment
Remarks:
The Next method returns the next segment on a subpath. If the last segment is reached and the subpath is not closed, Nothing is returned
Examples:
The following VBA example creates a triangle, converts the three segments to curves, and changes the type of the bottom nodes to smooth, producing a shape resembling a droplet. Sub Test()
Dim s As Shape Dim seg As Segment Set s = ActiveLayer.CreatePolygon(3, 6, 7, 2, 3) s.ConvertToCurves s.Curve.Nodes.Range(2, 4, 6).Delete Set seg = s.Curve.Segments(2) seg.Previous.Type = cdrCurveSegment seg.Next.Type = cdrCurveSegment seg.Type = cdrCurveSegment seg.StartNode.Type = cdrSmoothNode seg.EndNode.Type = cdrSmoothNode 
End Sub