API Documentation > CorelDRAW > 2025-v26 > Segment > IVGSegment
Segment.GetPointPositionAt method
Gets the coordinates of a point located on the curve
Syntax:
Sub GetPointPositionAt(ByRef x As Double, ByRef y As Double, Optional ByVal Offset As Double = 0.5, Optional ByVal OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset)
Parameters:
Name Type Description
x
Double
y
Double
Offset
Double
Specifies the offset, in document units, from the beginning of the segment's subpath. 5.
OffsetType
Specifies the offset type of the point on the curve's subpath, and returns cdrSegmentOffsetType.
Remarks:
The GetPointPositionAt method returns the coordinates of a point located on a segment.
Examples:
Here is a code example:
Sub GetPointPositionAt_Sample()
Dim s1 As Shape
Set s1 = ActiveLayer.CreateLineSegment(1.698224, 8.796287, 3.094059, 8.22337)
s1.Outline.SetProperties 0.1

'Someone could trace a constellation
'For this example we created Ursa Major using the code below
Dim crv As Curve
Set crv = ActiveDocument.CreateCurve
With crv.CreateSubPath(1.698224, 8.796287)
  .AppendLineSegment 3.094059, 8.22337
  .AppendLineSegment 3.583642, 7.317118
  .AppendLineSegment 4.229476, 6.317118
  .AppendLineSegment 6.239894, 5.306701
  .AppendLineSegment 5.364894, 4.348366
  .AppendLineSegment 3.885724, 5.317118
  .AppendLineSegment 4.229476, 6.317118
End With
s1.Curve.CopyAssign crv

'This portion of the sample code could be run to
'automatically create the position of each star in the constellation
Dim sStarPosition As Shape
Dim x As Double, y As Double
Dim sg As Segment
For Each sg In ActiveShape.Curve.Segments
  sg.GetPointPositionAt x, y, 0.01, cdrAbsoluteSegmentOffset
  Set sStarPosition = ActiveLayer.CreateEllipse2(x, y, 0.1)
  sStarPosition.Fill.UniformColor.BWAssign True
Next sg
 
End Sub