Previous Document Next Document
Segment.SubPath

Property SubPath As SubPath

Member of Segment

The SubPath property returns the SubPath object to which the segment belongs.

The SubPath property returns a read-only value.

The following code example creates a curve with two subpaths. The subpath that contains the seventh segment is copied as a curve, and a shape is then created from that curve.

Sub Test() 
 Dim s As Shape, s2 As Shape 
 Dim sp As SubPath, sp2 As SubPath 
 Dim crv As Curve, crv2 As Curve 
 Set crv = CreateCurve(ActiveDocument) 
 ActiveDocument.ReferencePoint = cdrBottomLeft 
 Set sp = crv.CreateSubPath(1, 1) 
 sp.AppendLineSegment 1, 1 
 sp.AppendCurveSegment 3, 3 
 sp.AppendCurveSegment 5, 1 
 sp.AppendCurveSegment 6, 4 
 sp.Nodes(2).Type = cdrSmoothNode 
 sp.Nodes(3).Type = cdrSmoothNode 
 Set sp2 = crv.CreateSubPath(6, 4) 
 sp2.AppendLineSegment 5, 7 
 sp2.AppendCurveSegment 3, 5 
 sp2.AppendCurveSegment 1, 7 
 sp2.Nodes(3).Type = cdrSmoothNode 
 sp2.Nodes(4).Type = cdrSmoothNode 
 Set s = ActiveLayer.CreateCurve(crv) 
 Set sp2 = s.Curve.Segments(7).SubPath 
 Set crv2 = sp2.GetCopy 
 Set s2 = ActiveLayer.CreateCurve(crv2) 
 s2.Move 0, 1 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.