Previous Document Next Document

Object Model Reference : Classes : A : Application : Methods : Application.CreateCurve


Application.CreateCurve

Function CreateCurve([Document As Document]) As Curve

Description

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 document’s system of measurement. This can be done by specifying the optional Document parameter in the CreateCurve method, or by using the Curve.BindToDocument method.

Parameter
Description
Document
Specifies the settings to apply
This paramater is optional, and its default value is Nothing.

VBA example

The following VBA 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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.