如何防止
为双击事件添加代码处理无名块时如何防止CAD调用refedit命令或者说:
为双击事件添加代码时如何防止CAD调用相关命令 斑竹可以说说么? 明总救救急呀 我已经弄清楚了
SendCommand "(command)" + vbCr
这么简单,哈哈 我试过无效 可以呀,明总,这是我的代码
Private Sub AcadDocument_BeginDoubleClick(ByVal PickPoint As Variant)<BR>On Error Resume Next<BR>Dim lBlockObject As AcadObject<BR>Dim ss As AcadSelectionSet<BR>Set ss = ThisDrawing.ActiveSelectionSet<BR>If ss.Count <> 1 Then Exit Sub<BR>Set lBlockObject = ss(0)<BR>Select Case ObjectType(lBlockObject)<BR>Case oNull<BR>ThisDrawing.SendCommand "(command) "<BR>Case oObject<BR>frmDwgC.Change lBlockObject<BR>ThisDrawing.SendCommand "(command) "<BR>Case oTable<BR>frmTable.Change lBlockObject<BR>ThisDrawing.SendCommand "(command) "<BR>End Select
End Sub
具体的处理部分没贴上,不过确实可以达到效果即:
为双击事件添加代码处理无名块时防止CAD调用refedit命令<BR> 但我这样却不行:Private Sub AcadDocument_BeginDoubleClick(ByVal PickPoint As Variant)
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.ActiveSelectionSet
MsgBox "当前选定的对象数量为" & ss.Count
ThisDrawing.SendCommand "(command)" + vbCr
End Sub refedit命令要求输入,用ThisDrawing.SendCommand "(command)" + vbCr可以消除,其他的就没办法了,可能是这个原因
页:
[1]