- 积分
- 261
- 明经币
- 个
- 注册时间
- 2004-6-21
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2004-6-28 14:19:00
|
显示全部楼层
Sub layer500() On Error Resume Next Dim i As AcadEntity Dim j As Integer Dim ft(0) As Integer Dim fd1(0 To 1) As String Dim fd(0) Dim ss As AcadSelectionSet ft(0) = 8 fd1(0) = "24,10" fd1(1) = "W" For j = 0 To 1 fd(0) = fd1(j) ThisDrawing.SelectionSets("CURRENT").Delete Set ss = ThisDrawing.ActiveSelectionSet ss.Select acSelectionSetAll, , , ft, fd
For Each i In ss i.Layer = j + 2 Next i ss.Clear ss.Delete Next j End Sub
我想用这个循环来做到10,24层的对象改变到第2层,W层的对象改变到第3层,结果发现10,24层的也变成第3层的了.调试的时候发现当j=1时,选择集把原来已经改为第二层的对象又选择到ss中去了.不知是为什么?谢谢帮我解答! |
|