API Documentation > CorelDRAW > 2025-v26 > Segment > IVGSegment
Segment.FindParamOffset method
Finds Parametric Offset
Syntax:
Function FindParamOffset(ByVal AbsoluteOffset As Double, ByRef ParamOffset As Double, Optional ByRef Remainder As Double = 0) As Boolean
Parameters:
Name Type Description
AbsoluteOffset
Double
ParamOffset
Double
Remainder
Double
Specifies the remainder.
Remarks:
The FindParamOffset method returns the parametric offset for a specified absolute offset. If the segment is shorter than the specified offset, the function returns False, and the remainder of the offset is returned in the Remainder parameter. Otherwise, the function returns True, and the ParamOffset parameter returns the parametric offset for the segment.
Examples:
The following VBA example duplicates a shape and distributes it along a path. The shape and the path must be selected, and the path must be selected last.
Sub Test()
Dim sr As ShapeRange
Dim sPath As Shape, sShape As Shape, sWork As Shape
Dim dWidth As Double, Offset As Double, Rest As Double, t As Double
Dim x As Double, y As Double, a As Double, sx As Double, sy As Double
Dim seg As Segment
Set sr = ActiveSelectionRange
If sr.Count <> 2 Then
  MsgBox "Please select two shapes", vbCritical
  Exit Sub
End If
If sr(1).Type <> cdrCurveShape Then
  MsgBox "Last selected shape must be a curve", vbCritical
  Exit Sub
End If
Set sPath = sr(1)
Set sShape = sr(2)
ActiveDocument.ReferencePoint = cdrCenter
dWidth = sShape.SizeWidth
sShape.GetPosition sx, sy
Offset = dWidth / 2
For Each seg In sPath.Curve.Segments
  While seg.FindParamOffset(Offset, t, Rest)

 seg.GetPointPositionAt x, y, t, cdrParamSegmentOffset

 a = seg.GetTangentAt(t, cdrParamSegmentOffset)

 Set sWork = sShape.Duplicate(x - sx, y - sy)

 sWork.Rotate a

 Offset = Offset + dWidth
  Wend
  Offset = Rest
Next seg 
End Sub