zhu1 发表于 2004-9-9 10:27:00

[VBA]请问:选择集过滤器为何不可用

<PRE>Dim SsetObj As AcadSelectionSet<BR>Dim filterType(0) As Integer, FilterDate As Variant<BR>filterType(0) = 0<BR>FilterDate = "Line"<BR>ThisDrawing.SelectionSets("AA").Delete<BR>Set SsetObj = ThisDrawing.SelectionSets.Add("AA")<BR>                       SsetObj. filterType, FilterDate</PRE><PRE>显示的错误为filterType, FilterDate参数在SelectOnScreen不可用</PRE><PRE>请问有什么方法可以解决?</PRE><PRE>如果用句柄遍历所有对象怎么样去做,请明示.谢谢</PRE>

雪山飞狐_lzh 发表于 2004-9-9 10:56:00

1、FilterDate = "Line"<BR>?


dim FilterDate(0) As Variant


FilterDate(0) = "Line"<BR>


2、HandleToObject方法

zhu1 发表于 2004-9-9 19:33:00

不行啊


错误为:找不到主健

雪山飞狐_lzh 发表于 2004-9-9 19:39:00

前面加上on error resume next

wyj7485 发表于 2004-9-10 08:48:00

Sub SSet()<BR>On Error Resume Next<BR>Dim SsetObj As AcadSelectionSet<BR>Dim filterType(0) As Integer, FilterDate(0) As Variant<BR>filterType(0) = 0<BR>FilterDate(0) = "Line"<BR>ThisDrawing.SelectionSets("AA").Delete<BR>Set SsetObj = ThisDrawing.SelectionSets.Add("AA")<BR>SsetObj.SelectOnScreen filterType, FilterDate


End Sub<BR>

zhu1 发表于 2004-9-10 10:30:00

谢谢各位的帮助


我的问题已经得到解决


我会努力学的更好
页: [1]
查看完整版本: [VBA]请问:选择集过滤器为何不可用