Previous Document Next Document
Curve.SubPaths

Property SubPaths As SubPaths

Member of Curve

The SubPaths property returns a collection of all subpaths in the curve. A subpath is a curve or shape within a single curve object. Curve objects may have several subpaths and each member of the subpath collection is identified by its index number. For example, Subpaths(2) refers to the second subpath of a selected curve object in CorelDRAW.

The SubPaths property returns a read-only value.

The following code example creates a rectangle around each subpath of each curve in the selection.

Sub Test() 
 Dim s As Shape 
 Dim spath As SubPath 
 Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double 
 ActiveDocument.ReferencePoint = cdrBottomLeft 
 For Each s In ActiveSelection.Shapes 
  If s.Type <> cdrCurveShape Then s.ConvertToCurves 
  If s.Type = cdrCurveShape Then 
   For Each spath In s.curve.Subpaths 
    x1 = spath.PositionX 
    y1 = spath.PositionY 
    x2 = x1 + spath.SizeWidth 
    y2 = y1 + spath.SizeHeight 
    ActiveLayer.CreateRectangle x1, y1, x2, y2 
   Next spath 
  End If 
 Next s 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.