- 积分
- 2413
- 明经币
- 个
- 注册时间
- 2004-3-20
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2004-6-1 18:49:00
|
显示全部楼层
Sub test1() Dim number As Integer
Dim ObjSelectionSet As AcadSelectionSet
j = 0
'获取当前图形中选择集的个数
number = ThisDrawing.SelectionSets.Count
'删除当前图形中所有的选择集
While j < number
Set ObjSelectionSet = ThisDrawing.SelectionSets.Item(0)
ObjSelectionSet.Delete
j = j + 1
WendDim ss As AcadSelectionSet
Set ss = ThisDrawing.ActiveSelectionSet
ss.Select acSelectionSetAll
ThisDrawing.Wblock "c:\123.dwg", ss
For Each I In ThisDrawing.ModelSpace
I.Delete
Next I
ss.Clear
ss.Delete
End Sub[CODE][/CODE]上面这段代码怎么只能运行一遍,第二次就出现错误,[SHADOW=255,blue,1]文字[/SHADOW]运行到Set ss = ThisDrawing.ActiveSelectionSet提示出错了?? |
|