- 积分
- 24557
- 明经币
- 个
- 注册时间
- 2004-3-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-10-20 20:54:00
|
显示全部楼层
本帖最后由 作者 于 2004-10-20 21:37:16 编辑
- Sub SelectSp()
- On Error Resume Next
- Dim SSpline As AcadSelectionSet
- Dim SLine As AcadSelectionSet
- Dim ft(0) As Integer, fd(0)
- Dim Pline As AcadLine
- Dim s, t
- Dim i As Integer, j As Integer, k As Integer
- Dim str As String
- Dim pInsertPnt
-
- ThisDrawing.SelectionSets("Spline").Delete
- ThisDrawing.SelectionSets("Line").Delete
-
- Set SSpline = ThisDrawing.SelectionSets.Add("Spline")
- ft(0) = 0: fd(0) = "Spline"
- SSpline.Select acSelectionSetAll, , , ft, fd
-
- Set SLine = ThisDrawing.SelectionSets.Add("Line")
- ft(0) = 0: fd(0) = "Line"
- SLine.Select acSelectionSetAll, , , ft, fd
-
- For Each Pline In SLine
- For s = 0 To SSpline.Count - 1
- pInsertPnt = Pline.IntersectWith(SSpline(s), acExtendNone)
- j = 0
- For i = 0 To UBound(pInsertPnt)
- str = "Intersection Point[" & k & "] is: " & pInsertPnt(j) & "," & pInsertPnt(j + 1) & "," & pInsertPnt(j + 2)
- MsgBox str, , "IntersectWith Example"
- str = ""
- i = i + 2
- j = j + 3
- k = k + 1
- Next
- Next s
- Next Pline
- End Sub
|
|