Previous Document Next Document
Segment.BreakApartAt

Function BreakApartAt([Offset As Double = 0.5], [OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset (2)]) As Node

Member of Segment

The BreakApartAt method divides a segment into two unconnected segments at a given point.

Currently, this method fails even if the segment was split successfully. Therefore, you must use the On Error Resume Next statement to catch the error and continue execution.

Parameters
Description
Offset
Specifies the offset, in document units, from the beginning of a segment’s subpath
This parameter is optional, and its default value is 0.5.
OffsetType
Specifies the type of offset of a point on a curve’s subpath. This parameter returns cdrSegmentOffsetType.
This parameter is optional, and its default value is cdrParamSegmentOffset (2).

The following code 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.