Object Model Reference : Classes : C : Curve : Methods : Curve.CreateSubPathFromArray |
Function CreateSubPathFromArray(Source() As CurveElement, [Closed As Boolean = False], [NumElements As Long = -1]) As SubPath
Member of Curve
The CreateSubPathFromArray method adds a new subpath based on the properties of a specified node.
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 |
Copyright 2013 Corel Corporation. All rights reserved.