Previous Document Next Document

Object Model Reference : Classes : C : Curve : Properties : Curve.SubPaths


Curve.SubPaths

Property SubPaths As SubPaths

Description

Member of Curve

The SubPaths property returns all the subpaths in a curve.

 
A subpath is a curve or shape within a single curve object. A curve objects can have several subpaths, and each member of a SubPaths 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.

VBA example

The following VBA 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 2013 Corel Corporation. All rights reserved.