Previous Document Next Document
Segment.GetPointPositionAt

Sub GetPointPositionAt(x As Double, y As Double, [Offset As Double = 0.5], [OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset])

Member of Segment

The GetPointPositionAt method returns the coordinates of a point located on a segment.

Parameters
Description
x
Specifies the horizontal position of a point on a segment’s subpath. The x-coordinate is measured in document units.
y
Specifies the vertical position of a point on a segment’s subpath. The y-coordinate is measured in document units.
Offset
Specifies the offset , in document units, from the beginning of a segment’s subpath.
This parameter is optional, and its default value is 0.5.
OffsetType
Specifies the offset type of a point on a curve’s subpath. This parameter returns cdrSegmentOffsetType.
This parameter is optional, and its default value is cdrParamSegmentOffset (2).

The following code example creates five small ellipses distributed evenly along each segment of the selected curve:

Sub Test() 
 Dim seg As Segment 
 Dim t As Double, x As Double, y As Double 
 For Each seg In ActiveShape.Curve.Segments 
  For t = 0 To 0.9 Step 0.2 
   seg.GetPointPositionAt t, cdrRelativeSegmentOffset, x, y 
   ActiveLayer.CreateEllipse2 x, y, 0.03 
  Next t 
 Next seg 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.