API Documentation > CorelDRAW > 2025-v26 > Segment > IVGSegment
Segment.BreakApartAt method
Breaks this segment into two unconnected segments
Syntax:
Function BreakApartAt(Optional ByVal Offset As Double = 0.5, Optional ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset) As Node
Parameters:
Name Type Description
Offset
Double
Specifies the offset, in document units, from the beginning of the segment's subpath. 5.
OffsetType
Specifies the type of offset of the point on the curve's subpath, and returns cdrSegmentOffsetType.
Remarks:
The BreakApartAt method divides a segment into two unconnected segments at a given point. Currently, this method fails even if the segment is split successfully. Therefore, you must use the On Error Resume Next statement to catch the error and continue execution.
Examples:
The following VBA example creates a curve segment and divides it into two pieces at a point that is 1.3" from the beginning of the segment.
Sub Test()
Dim s As Shape
Set s = ActiveLayer.CreateCurveSegment(2, 8.3, 5.3, 8.5, 1.5, -62, 2.4, 84)
On Error Resume Next ' Lines in green are a workaround
s.Curve.Segments(1).BreakApartAt 1.3, cdrAbsoluteSegmentOffset
On Error GoTo 0 
End Sub