Public Sub test2()
Dim mypline As AcadLWPolyline
Dim ss1 As AcadSelectionSet
Dim pt As Variant
Dim points As Variant
Call ThisDrawing.Utility.GetEntity(mypline, pt, "22=")
Call bulidselction(ss1, 1) '创建选择集
points = mypline.Coordinates
ss1.SelectByPolygon acSelectionSetCrossingPolygon, points
Debug.Print ss1.count
End SubPublic Sub bulidselction(mysle As AcadSelectionSet, pp As String)
'定义名为PP的选择集,赋值于mysle,若存在则引用,不存在则创建
Dim k As Integer
Dim num As Integer
Dim aaa As Boolean
aaa = False
For k = 0 To ThisDrawing.SelectionSets.count - 1
If ThisDrawing.SelectionSets.Item(k).Name = pp Then
aaa = True
num = k
Exit For
End If
Next k
If aaa = True Then
Set mysle = ThisDrawing.SelectionSets.Item(pp)
mysle.Delete
Set mysle = ThisDrawing.SelectionSets.add(pp)
Else
Set mysle = ThisDrawing.SelectionSets.add(pp)
End If
End Sub该段程序为何无法执行