为什么最后一句代码不能执行?
Dim I As Integer<BR>Dim GpCode(0 To 1) As Integer<BR>Dim DateValue(0 To 1) As Variant<BR> GpCode(0) = 0: GpCode(1) = 5<BR> DateValue(0) = "TEXT": DateValue(1) = 12195<BR>Dim FilterType As Variant, FilterDate As Variant<BR> FilterType = GpCode<BR> FilterDate = DateValue<BR>Dim SsetObj As AcadSelectionSet<BR> <BR> If ThisDrawing.SelectionSets.Count <> 0 Then<BR> For I = 0 To ThisDrawing.SelectionSets.Count - 1<BR> Set SsetObj = ThisDrawing.SelectionSets.Item(I)<BR> SsetObj.Delete<BR> Next<BR> End If<BR> <BR> Set SsetObj = ThisDrawing.SelectionSets.Add("AA")<BR> SsetObj.Select acSelectionSetAll, , , FilterType, FilterDate以上代码加上句柄后,最后一句就不能执行?(其中句柄值为图形中已存在的)
请高手指点门路....
谢谢!!<BR> 知道句柄不是就可以直接引用对象了吗?句柄是唯一的,何必要用选择集过滤? FilterType, FilterDate 要定义为数组,且FilterType为Integer<BR>、 FilterDate为Variant,如:<BR>Dim FilterType(0 To 1) As Integer<BR>Dim FilterDate(0 To 1) As Variant 句柄不能用在过滤条件中 每个对象的句柄都不一样,使用HandleToObject来返回对象最简便了。
页:
[1]