(defun c:tt1() (princ "this is a test" ))
编译后再反编译,成了
(vl-ACAD-defun (DEFUN C:TT1() (PRINC "this is a test" ) ) )
'C:TT1
这(vl-ACAD-defun 是什么鬼?
看了一下编译后的代码,原来一个(defun c:tt1被分成了两步,第一步是定义一个c:tt1函数,它是不能当命令运行的。第二步是调用(vl-ACAD-defun ,把c:tt1定义成AutoCAD命令。
改一下,去掉第二步试试。
试验结果如下:
命令: (LOAD "F:/00/sth2_new.fas") C:TT1
命令: tt1
未知命令“TT1”。按 F1 查看帮助。
命令: (c:tt1)
this is a test"this is a test"