1、第1行应将中文的左括号“(”改为英文的左括号“(”
2、第9行应将中文的右括号“)”改为英文的右括号“)”
3、(setq ainc (/circle lppass))应改为(setq ainc (/ circle lppass));注意有空格
4、 (setq dhinc (/hfac lppass))应改为(setq dhinc (/ hfac lppass))
5、 (if vfac (setq dvinc (/vfac lppass)))应改为 (if vfac (setq dvinc (/ vfac lppass)))
6、(if vfac
(setq dist strad dv 00))
(setq dist 00)
)
应改为
(if vfac
(setq dist strad dv 00) ;此外多了1个右括号
(setq dist 00)
)
(defun C:EditPline(/ cm allpline wfirst i wlast wlsat1 )
(setq cm (getvar "cmdecho"))
(setvar "cmdecho" 0)
;(setq allpline (ssget "X" `((0"PLINE")))) ;`((0"PLINE"))应该是'((0 "POLYLINE"))
(if (setq allpline (ssget "X" '((0 "POLYLINE"))))
(progn
(setq i 0 n (sslength allpline))
(repeat n
(setq wfirst (ssname allpline i))
(command "offset" "" "03" "" wfirst "1" "")
(setq wlast (entlast))
(command "region" "" wfirst "")
(command "region" "" wlast "")
(command "subtract" wlast "" wfirst "")
(setq wlast1 (entlast))
(command "extrude" "" wlast1 "" "2" "")
(command "SHA" "" "C" "")
(setq i (+i 1))
)
)
)
(setvar "cmdecho" cm)
(princ)
)
(defun c:txy( / xc yc r n m id )
(defun getdata()
(setq xc(atof(get_tile "X")))
(setq yc(atof(get_tile "Y")))
(setq r(atof(get_tile "R")))
(setq n(atof(get_tile "N")))
(setq m(atof(get_tile "M")))
)
(setq sdt 0)
(setq id(load_dialog "C:\\Users\\daili\\Desktop\\CAD\\tongxinyuandcl"))
(if (< id 0)(exit))
(setq xc 50 yc 50 r 5 n 10 m 5)
(if (not (new_dialog "txy" id))(exit))
(set_tile "X" (rtos xc 2 2))
(set_tile "Y" (rtos yc 2 2))
(set_tile "R" (rtos r 2 2))
(set_tile "N" (rtos n 2 2))
(set_tile "M" (rtos m 2 2))
(action_tile "accept" "(getdata) (done_dialog 1)")
(action_tile "cancel" "(done_dialog -1)")
(setq sdt (start_dialog))
(unload_dialog id)
(if (> sdt 0)
(Repeat n
(Command "circle" (list xc yc) r)
(Setq r (+ r m))
)
(princ)
)
)
没什么问题 最后一个括号没有用美式用的是中式 另外最后再补一个括号就好了 上面是我改好的 只要是列表有缺陷 你就查括号有没有少或者不对 用一个专门的代码编辑器吧 比较容易看出括号形式或数量不对
(defun c:door (/ lng p0 p1 p2 p3 p4 p5 pt0 pt1 pt2 pt3 pt4 pt5 mp1 mp2
mp3)
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(setq lng (getreal "\n请输入门宽:"))
(setq p0 (getpoint "\n请输入门左下角点"))
;画第一个门垛
(setq p1 (polar p0 0 60))
(setq p2 (polar p1 (/ pi 2) 40))
(setq p3 (polar p2 pi 20))
(setq p4 (polar p3 (/ pi 2) 40))
(setq p5 (polar p4 pi 40))
(command "pline" p0 p1 p2 p3 p4 p5 "c")
;画第二个门垛
(setq pt0 (polar p0 0 lng))
(setq pt1 (polar pt0 pi 60))
(setq pt2 (polar pt1 (/ pi 2) 40))
(setq pt3 (polar pt2 0 20))
(setq pt4 (polar pt3 (/ pi 2) 40))
(setq pt5 (polar pt4 0 40))
(command "pline" pt0 pt1 pt2 pt3 pt4 pt5 "c")
;画门及旋转轨迹
(setq lg (- lng 80))
(setq mp1 (polar pt4 (/ pi 2) lg))
(setq mp2 (polar mp1 pi 40))
(setq mp3 (polar pt4 pi 40))
(command "pline" pt4 mp1 mp2 mp3 "c")
(command "arc" "c" pt4 mp1 p4)
(prin1)
)
;;朋友是搞室内设计的?我看别人都是用的块嘛,或者用动态块,可以调节大小的。
以上就是关于LISP程序调试有误 找不到错误全部的内容,包括:LISP程序调试有误 找不到错误、lisp程序:谁能帮我看一下,为什么我这个函数加载运行总是错误!!感激不尽、lisp错误提示:输入的列表有缺陷等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)