//aardio 调用 AutoCAD - 加载 LISP 代码 import com.cad; var cad = com.cad(); cad.ShowForeground();//前置并显示窗口 //加载 LISP 代码或者 LSP 文件。 //支持模板语法: doc://language-reference/templating/syntax.md cad.LoadLisp(` (setq c:hello nil) (defun c:hello(/ name) (set 'name (getstring "What's your name? ")) (set 'msg (strcat "Hello, " name )) (write-line msg))`,/*可选用 参数@2 指定模板 owner 参数*/); //执行 AutoCAD 里所有命令以及 AutoLISP 表达式,跟在 AutoCAD 里敲命令效果一样。 cad.SendCommand("hello"); //cad.SendCommand 同样支持模板语法。 //aardio 表转 LISP 点对,首尾自动加括号 //cad.SendCommand(`(print ' )` ); //aardio 数组输出为 LISP 列表,首尾不会自动加括号 //cad.SendCommand(`(print '() )` ); /* cad.SendCommand 是同步执行命令, 如果要异步执行命令请使用 cad.PostCommand */