嗨,Henrique,
非常感谢!这就是我要找的!
我现在正在为程序添加一些错误检查,当我试图在AutoCAD中测试它时,我遇到了另一个错误。
- (defun c:test (/ obj rad cen wipeout)
- ;;this lisp will create a wipeout for a circle when selected by the user
- (if (setq obj (entget (car(entsel"\nSelect Circle to Wipeout: "))))
- (if (/= circle (cdr (assoc 0 obj)))
- (setq rad (cdr (assoc 40 obj)));;get radius from selection and set to "rad"
- (setq cen (cdr (assoc 10 obj)));;get center point from selection and set to "cen"
- (command
- "_.polygon" 50 cen "_C" rad
- )
- (setq poly (entlast));;set last entity to variable "poly"
- (command
- "_.wipeout" "_p" poly "_Y"
- )
- (setq wipeout (entlast));;set last entity to variable "wipeout"
- (command
- "_.draworder" wipeout "" "_b";;put wipeout behind object
- )
- (princ)
- (ALERT "YOU DIDN'T SELECT A CIRCLE")
- );;END 2ND IF
- (ALERT "YOU DIDN'T SELECT AN OBJECT")
- );;END 1ST IF
- )
我遇到了太多的参数错误
也许有人可以给我一些关于如何运行错误检查的见解。我最讨厌的一点是,当if运行nil值时,它仍然继续执行命令。我试着让它跳到结尾,或者重复到开头。
李:我一定会调查那个节目的。
谢谢 |