是的,我知道它会计算所有的getpoint表达式,无法解决这个问题,直到遵循您的建议,传递未计算参数的列表:
- (defun _or ( LstOfAnythings / r ); return the first non-nil value, instead of just T or nil, seems to work
- (apply 'and (mapcar '(lambda (x) (= 'STR (type x))) LstOfAnythings))
- (vl-some
- (function
- (lambda (x)
- (and
- (not (vl-catch-all-error-p (setq r (vl-catch-all-apply 'eval (list (read x))))))
- (not (eq r nil))
- )
- )
- )
- LstOfAnythings
- )
- r
- )
测试功能:
- (if ; test function
- (setq p
- (_or
- (list
- "(getpoint "\nFirst try: ")"
- "(getpoint "\nSecond try: ")"
- "(getpoint "\nThird try: ")"
- )
- )
- )
- (entmakex (list (cons 0 "POINT") (cons 62 1) (cons 10 p)))
- )
谢谢
我觉得可能还有另一种方式来申请。
对不起,罗伊,我什么都看不见。。有什么提示吗? |