API Documentation > CorelDRAW > 2025-v26 > CrossPoints > IVGCrossPoints
CrossPoints.Count property
Gets the number of CrossPoints in the CrossPoint collection
Syntax:
Property Get Count() As Long
Remarks:
The Count property returns the number of intersection points that are found. The value depends on the OffsetType parameter in the call to the GetIntersections method.
Examples:
The following VBA example creates two separate ellipses with the CreateEllipse method. The active document is cleared, both ellipses are added to the active selection, and the ellipses are combined to create a single shape object. The intersections, or CrossPoints, of this new shape are identified by creating small circles around each point, using its x- and y-coordinates to serve as the coordinates of the small circles. The number of crosspoints and the x-position of the first crosspoint display in a message box.
Sub XPosition()
Dim s1 As Shape, s2 As Shape
Dim s As Shape
Dim cps As CrossPoints
Dim cp As CrossPoint
Set s1 = ActiveLayer.CreateEllipse(4, 2, 1, 0)
Set s2 = ActiveLayer.CreateEllipse(3, 1, 2, 5)
ActiveDocument.ClearSelection
s1.AddToSelection
s2.AddToSelection
ActiveSelection.Combine
Set s = ActiveSelection.Shapes(1)
Set cps = s.Curve.Subpaths(1).GetIntersections(s.Curve.Subpaths(2))
MsgBox cps.Count
MsgBox cps.Item(1).PositionX 
End Sub