![]() |
![]() |
Application.CreateCurve
Function CreateCurve([Document As Document]) As Curve
Member of Application
The CreateCurve method creates a curve in memory and optionally binds it to a document.
Any changes made to the curve in memory do not affect the document, and are, therefore, performed very fast.
When you work with coordinates (for example, setting the position of a node, getting the length of a curve, and so on), it is important to know which document to reference. You can attach a curve in memory to a document to use that documents system of measurement. This can be done by specifying the optional Document parameter in the CreateCurve method, or by using the BindToDocument method.
Parameters
|
Description
|
Document
|
Specifies the settings to apply
This paramater is optional, and its default value is Nothing.
|
The following code example creates a curve on the active layer using the settings of the active document.
Sub Test() Dim crv As Curve Dim s As Shape Dim sp As SubPath Set crv = Application.CreateCurve(ActiveDocument) Set sp = crv.CreateSubPath(1, 5) sp.AppendLineSegment 2, 0 sp.AppendCurveSegment2 5, 7, 6, 6, 3, 5 sp.AppendCurveSegment2 7, 2, 3, 6, 7, 1 sp.AppendLineSegment 9, 6 sp.Nodes(3).Type = cdrSmoothNode Set s = ActiveLayer.CreateCurve(crv) End Sub You can also use the New keyword to create a curve in memory. Dim crv As Curve Set crv = New Curve
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.