lisp 传递参数
各位请问一个lisp调用另一个lisp能否带个参数(setq a "参数")(load "test.lisp")
如上,能否把a传递到test.lisp中去,TKS
cad的变量默认状态就是全局变量,一处赋值可以多个程序使用的。如果用了独立命名空间,才会出现不能用的问题 把a设为全局变量应该可以
(defun c:tt5 ()
(setq a (getpoint))
(c:tt6)
)
(defun c:tt6 (/ b)
(if (not a) (setq b(getpoint)) (setq b a a nil))
(command "circle" "non" b 200)
) 本帖最后由 slysmart 于 2020-2-25 14:18 编辑
start4444 发表于 2020-2-25 12:56
把a设为全局变量应该可以
(defun c:tt5 ()
虽然现在还不是很明白,但非常感谢
你这个好像是在同一个lisp,函数之间参数传递
而不是一个lisp文件调用另一个lisp
本帖最后由 tryhi 于 2020-2-26 10:09 编辑
;;将此代码保存为a.lsp后加载
(defun c:tt ()
(setq a "参数")
(load "b.lsp")
)
;;将此代码保存为b.lsp,不加载
(alert a)
运行tt,则调用b.lsp并传递了参数
页:
[1]