Previous Document Next Document
Curve.Length

Property Length As Double

Member of Curve

The Length property returns the total length of a selected curve object in CoreDRAW.

The curve calculation is an approximation; the length cannot be calculated with absolute mathematical precision. The precision of the calculation can be set with the CurvePrecision property of the Document object.

The Length property returns a read-only value.

The following code example selects a shape object in the active document and determines if that shape is a curve object. If the shape is a curve, a message box displays the length of that curve, in a measurement of inches.

Sub CurveLength() 
 Dim s As Shape 
 Set s = ActiveSelection.Shapes(1) 
 If s.Type = cdrCurveShape Then 
  MsgBox "The length of the curve is: " _ 
  & vbCrLf & s.Curve.Length & " inches" 
 End If 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.