以下程序不需要写LISP程序加载执行,只需要将程序文件放到启动组中以后就可以直接在命令行中输入命令执行:
本来想调用VL类来隐去命令行定义命令部分,但VL类不能使用defun和defun-q命令,只好作罢
- Public TestLoad As Boolean
- Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
- If Not TestLoad Then
- ThisDrawing.SendCommand "(defun c:Test()(princ))(princ)" & vbCr
- TestLoad = True
- End If
- End Sub
- Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)
- If FirstLine = "(C:TEST)" Then Call TEST
- End Sub
- Sub TEST()
- MsgBox "这是一个自动加载的程序,不需要手工加载执行," & vbCrLf & "只需要将程序文件放到启动组中以后就可以直接输入命令执行。", , "明经通道VBA示例"
- End Sub
|