熊哥哥 发表于 2005-1-5 23:32:00

lisp的奇怪的现象

此程序不能在2004中运行



(defun c:g4 ( txt / ent newtxt)<BR>        (ltload)<BR>        (if (= txt 0)<BR>       (setq ent (ssget))<BR>       (setq ent (ssget (cgfin)))<BR>        )<BR>       (setvar "cmdecho" 0)<BR>       (command "change" ent "" "p" "C" 4 "LT" "DASHED2" "")<BR>       (prin1)<BR>)


而此程序能在2004中运行


(defun c:g5 ( txt / ent newtxt)<BR>        (if (= txt 0)<BR>       (setq ent (ssget))<BR>       (setq ent (ssget (cgfin)))<BR>        )<BR>       (setvar "cmdecho" 0)<BR>       (command "change" ent "" "p" "C" 5 "LT" "CONTINUOUS" "")<BR>       (prin1)<BR>)

sieben 发表于 2005-1-5 23:43:00

上面两个程序均不能运行,C:程序不能带参数,另外第一个程序不行可能是因为"DASHED2"线型还没有载入

熊哥哥 发表于 2005-1-5 23:48:00

不好意思我贴错了把才开始试验的贴上去了


应该是这样的


(defun c:c4 ()<BR>       (cg4 0)


(defun cg4 ( txt / ent newtxt)<BR>        (ltload)<BR>        (if (= txt 0)<BR>       (setq ent (ssget))<BR>       (setq ent (ssget (cgfin)))<BR>        )<BR>       (setvar "cmdecho" 0)<BR>       (command "change" ent "" "p" "C" 4 "LT" "DASHED2" "")<BR>       (prin1)<BR>)

meflying 发表于 2005-1-6 08:15:00

没有给出子函数,无法调试。。。


TO 2楼,C:函数可以带参数,只是不能在命令行使用命令而已,可以使用(c:xxx var)调用

wdb 发表于 2005-1-6 08:25:00

少了一个括号


(defun c:c4 ()<BR>       (cg4 0)<BR>);这里添加右括号<BR>(defun cg4 ( txt / ent newtxt)<BR>        ;(ltload)<BR>        (if (= txt 0)<BR>       (setq ent (ssget))<BR>       ;(setq ent (ssget (cgfin)))<BR>        )<BR>       (setvar "cmdecho" 0)<BR>       (command "change" ent "" "p" "C" 4 "LT" "DASHED2" "")<BR>       (prin1)<BR>)<BR>

xstlf 发表于 2005-1-6 08:34:00

meflying发表于2005-1-6 8:15:00static/image/common/back.gif没有给出子函数,无法调试。。。



TO 2楼,C:函数可以带参数,只是不能在命令行使用命令而已,可以使用(c:xxx var)调用

<BR>调用?一般出现在什么情况下才调用呀?

熊哥哥 发表于 2005-1-9 22:45:00

我的目的就是编一个改线型及颜色的LISP!


<A name=3802><FONT color=#990000><B>meflying</B></FONT></A>老兄能帮我改一下吗

meflying 发表于 2005-1-10 08:23:00

我4楼的话没看见吗?

熊哥哥 发表于 2005-1-11 18:51:00

谢谢<A name=4599><FONT color=#990000><B>meflying</B></FONT></A>
页: [1]
查看完整版本: lisp的奇怪的现象