![]() |
![]() |
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 segments subpath. The x-coordinate is measured in document units.
|
y
|
Specifies the vertical position of a point on a segments subpath. The y-coordinate is measured in document units.
|
Offset
|
Specifies the offset , in document units, from the beginning of a segments subpath.
This parameter is optional, and its default value is 0.5.
|
OffsetType
|
Specifies the offset type of a point on a curves 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
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.