Previous Document Next Document

Object Model Reference : Classes : S : Segment : Methods : Segment.BreakApartAt


Segment.BreakApartAt

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

Description

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 is split successfully. Therefore, you must use the On Error Resume Next statement to catch the error and continue execution.

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

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.