Previous Document Next Document

Object Model Reference : Classes : C : Curve : Methods : Curve.CreateSubPathFromArray


Curve.CreateSubPathFromArray

Function CreateSubPathFromArray(Source() As CurveElement, [Closed As Boolean = False], [NumElements As Long = -1]) As SubPath

Description

Member of Curve

The CreateSubPathFromArray method adds a new subpath based on the properties of a specified node.

Parameter
Description
Source
Specifies the curve element to use as a source
Closed
Specifies whether the curve is closed, but does not automatically close the curve. The starting and ending nodes must have the same coordinates. This parameter is optional, and its default value is False.
NumElements
Specifies the number of valid curve elements to use. If nothing is specified, then all valid curve elements are used. This parameter is optional, and its default value is -1.

VBA example

The following VBA example creates a curve.

Sub Test()
 Dim ce(5) As CurveElement
 Dim crv As Curve
 ce(0).ElementType = cdrElementStart
 ce(0).PositionX = 0
 ce(0).PositionY = 0
 ce(1).ElementType = cdrElementLine
 ce(1).NodeType = cdrSmoothNode
 ce(1).PositionX = 1
 ce(1).PositionY = 1
 ce(2).ElementType = cdrElementControl
 ce(2).PositionX = 2
 ce(2).PositionY = 2
 ce(3).ElementType = cdrElementControl
 ce(3).PositionX = 3
 ce(3).PositionY = 2
 ce(4).ElementType = cdrElementCurve
 ce(4).NodeType = cdrSmoothNode
 ce(4).PositionX = 4
 ce(4).PositionY = 1
 ce(5).ElementType = cdrElementLine
 ce(5).PositionX = 5
 ce(5).PositionY = 0
 Set crv = CreateCurve(ActiveDocument)
 crv.CreateSubPathFromArray ce
 ActiveLayer.CreateCurve crv
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.