Previous Document Next Document

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


Curve.CreateSubPath

Function CreateSubPath(x As Double, y As Double) As SubPath

Description

Member of Curve

The CreateSubPath method creates a subpath for a curve. The CreateSubPath method requires x- and y-coordinates to represent the first node in the subpath.

Parameter
Description
x
Specifies the horizontal position for the first node in a curve object’s new subpath
y
Specifies the vertical position for the first node in a curve object’s new subpath

VBA example

The following VBA example creates a curve with two line segments and three curve segments within the subpath.

Sub Test()
 Dim s As Shape
 Dim sp As SubPath
 Dim crv 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 7, 4
 sp.AppendLineSegment 9, 0
 sp.Nodes(2).Type = cdrSmoothNode
 sp.Nodes(3).Type = cdrSmoothNode
 sp.Nodes(4).Type = cdrSmoothNode
 sp.Nodes(5).Type = cdrSmoothNode
 Set s = ActiveLayer.CreateCurve(crv)
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.