View Single Post
Old 03-07-2005, 11:48
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Also Try SubPath.GetIntersections

You might also try SubPath.GetIntesections, example follows:

The following 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
Reply With Quote