以下程序如果先采取双击鼠标中键对图形进行范围缩放后再运行就会出现提示“自动化无法完成”的错误,但如果在命令行输入zoom命令来对图形实现范围缩放就没任何问题,不知道是不是CAD的问题,该如何解决?先谢谢各位了
Sub test() Dim i As Integer Dim sset As AcadSelectionSet For i = ThisDrawing.SelectionSets.Count - 1 To 0 Step -1 If ThisDrawing.SelectionSets.Item(i).Name = "SS1" Then ThisDrawing.SelectionSets.Item(i).Delete Exit For End If Next i Set sset = ThisDrawing.SelectionSets.Add("SS1") sset.Select acSelectionSetAll MsgBox sset.Count For i = ThisDrawing.SelectionSets.Count - 1 To 0 Step -1 If ThisDrawing.SelectionSets.Item(i).Name = "SS1" Then ThisDrawing.SelectionSets.Item(i).Delete Exit For End If Next i End Sub |