jsatbdg 发表于 2022-7-6 06:29:50

lisp错误

正在寻找有关lisp命令的帮助。。。。。
 
我们有一个用于种植计划的lisp命令,它允许用户从自定义植物列表中进行选择,输入植物数量,完成后,它会编写一个植物列表,对所有植物进行计数。使用了两个命令:PLANTLAB允许您选择植物块符号和数量。PLANTLIST写入列表。我以前使用的是AutoCad 2008,它工作得很好,但现在我更新到2013年,当我键入PLANTLIST时,出现了“参数太多”错误,不知道为什么。其他一切都很好。我对写口吃一无所知,希望有人能给我点启发。
 
PLANTLIST的lisp如下:
 
(defun c:plantlist()
(setq qtylist nil)
(setq keystr nil)
(setq qtystr nil)
(setq tablist nil)
; (setq txtsample(getstring“\n输入工厂标签:”))
(setq sspltab(ssget“X”'((0。“TEXT”)(8。“plating-TAB”)))
(setq sstablen(sslength sspltab))
(setq cyc2 0)
(虽然(
(setq sspl(ssname sspltab cyc2))
(setq txtsample(cdr(assoc’1(entget sspl)))
(setq textlen(strlen txtsample))
(setq cyc 1)
(虽然(
(如果(=(substr txtsample cyc 1)“”)
(程序
(setq qtystr(atoi(substr txtsample 1(-cyc 1)))
(setq keystr(substr txtsample(+cyc 1)))
(setq cyc textlen)
)
)
(setq cyc(+cyc 1))
)
(setq cyc2(+cyc2 1))
(planttab)
)
(prin1)
)
(defun planttab()
(setq tmpqty 0)
(如果(=tablist nil)
(程序
(setq tmplist(list keystr qtystr))
(setq tablist(列表tmplist))
)
(程序
(setq tmplen(长度列表))
(setq cyc3 0)
(setq发现无)
(虽然(
(if(=(第n个0(第n个cyc3 tablist))键tr)
(程序
(setq发现T)
(setq未发现cyc3)
(setq tmpqty(第n个1(第n个cyc3列表)))
)
)
(setq cyc3(+cyc3 1))
)
(如果(=发现T)
(程序
(setq tmplist nil)
(setq tmpqty(+tmpqty qtystr))
(setq tmplistnew(list keystr tmpqty))
(setq cyc3(-tmplen 1))
(而(>cyc3 foundno)
(setq tmplist(cons(第n个cyc3 tablist)tmplist))
(setq cyc3(-cyc3 1))
)
(setq tmplist(cons tmplist NEW tmplist))
(setq cyc3 0)
(虽然(
(setq tmplist(cons(第n个cyc3 tablist)tmplist))
(setq cyc3(+cyc3 1))
)
(setq tablist tmplist)
)
(程序
(setq tmplistnew(list keystr qtystr))
(setq tablist(cons tmplistnew tablist))
)
)
)
)
)

SLW210 发表于 2022-7-6 07:28:20

请阅读代码发布指南,编辑您的帖子,并将代码放在代码标签内。
 
我把你的帖子移到了AutoLISP、Visual LISP和DCL论坛。

Lee Mac 发表于 2022-7-6 07:54:54

您可以按照本教程确定错误的来源:
 
使用Visual LISP IDE调试代码
页: [1]
查看完整版本: lisp错误