Private Sub addcommand() ThisDrawing.SendCommand "(defun C:AZJ() (command " & Chr(34) & "-vbarun" & Chr(34) & Chr(32) & Chr(34) & "azjmjsj" & Chr(34) & "))" & Chr(32) ThisDrawing.SendCommand "(defun C:ABC() (command " & Chr(34) & "-vbarun" & Chr(34) & Chr(32) & Chr(34) & "abcde" & Chr(34) & "))" & Chr(32) End Sub Private Sub AcadDocument_BeginCommand(ByVal CommandName As String) If StrComp(Left$(CommandName, 3), "VBA", 1) <> 0 And UCase$(CommandName) <> "APPLOAD" Then Exit Sub addcommand End Sub Private Sub AcadDocument_EndCommand(ByVal CommandName As String) If StrComp(Left$(CommandName, 3), "VBA", 1) <> 0 And UCase$(CommandName) <> "APPLOAD" Then Exit Sub addcommand End Sub **************************************************************************** 西北凡人: http://www.abofanyi.com/blog |