yulijin608 发表于 2006-8-1 15:08:00

[求助]鼠标中键问题

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