|
下面是帮助系统中的原文:
Selects an object passing through a given point and places it into a selection set.
在实用中,不如用下面的函数来代替:
' 选择通过某点的实体
Public Sub SelectAtPoint(ByRef SSet As AcadSelectionSet, ByVal pt As Variant)
' 构造一个以pt为中心的小矩形作为选择范围
Dim pt1 As Variant, pt2 As Variant
Dim objUtility As Object
Set objUtility = ThisDrawing.Utility ' 必须使用后期绑定
objUtility.CreateTypedArray pt1, vbDouble, pt(0) - 0.01, pt(1) - 0.01, pt(2)
objUtility.CreateTypedArray pt2, vbDouble, pt(0) + 0.01, pt(1) + 0.01, pt(2)
SSet.Select acSelectionSetCrossing, pt1, pt2
MsgBox SSet.count
End Sub |
|