API Documentation > CorelDRAW > 2025-v26 > SubPath > IVGSubPath
SubPath.GetIntersections method
Finds the intersection point(s) with another subpath
Syntax:
Function GetIntersections(ByVal Target As SubPath, Optional ByVal OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset) As CrossPoints
Parameters:
Name Type Description
Target
OffsetType
Specifies the offset type of the intersection point, and returns cdrSegmentOffsetType.
Remarks:
The GetIntersections method finds all the points of intersection for two subpaths.
Examples:
The following VBA example displays the number of times the two selected curves intersect and marks each intersection point with a small circle.
Sub Test()
Dim sr As ShapeRange
Dim sp1 As SubPath, sp2 As SubPath
Dim cps As CrossPoints, cp As CrossPoint
Dim x As Double, y As Double, n As Long
Set sr = ActiveSelectionRange
If sr.Count <> 2 Then
  MsgBox "Please select two curves", vbCritical
  Exit Sub
End If
If sr(1).Type <> cdrCurveShape Or sr(2).Type <> cdrCurveShape Then
  MsgBox "One of the selected shapes is not a curve", vbCritical
  Exit Sub
End If
n = 0
For Each sp1 In sr(1).Curve.Subpaths
  For Each sp2 In sr(2).Curve.Subpaths

 Set cps = sp1.GetIntersections(sp2)

 For Each cp In cps


ActiveLayer.CreateEllipse2 cp.PositionX, cp.PositionY, 0.05

 Next cp

 n = n + cps.Count
  Next sp2
Next sp1
MsgBox n & " intersection point(s) found" 
End Sub