本帖最后由 kucha007 于 2022-11-19 22:18 编辑
这样?
- (defun C:TT (/ Old_Cmd SS P1 P2)
- (setq Old_Cmd (getvar "cmdecho"))(setvar "cmdecho" 0)
- (if (setq SS (SSget))
- (progn
- (setq P1 (getpoint "\n→请指定第一点"))
- (setq P2 (getpoint "\n→请指定第二点"))
- (cond
- ((and P1 P2)
- (progn
- (princ "\n→P1、P2都存在")(princ)
- )
- )
- ((and P1 (not P2))
- (progn
- (princ "\n→P1存在,但P2不存在")(princ)
- )
- )
- ((and (not P1) (not P2))
- (progn
- (princ "\n→P1、P2都不存在")(princ)
- )
- )
- )
- )
- (progn
- (princ "\n→未选择对象,命令结束")(princ)
- )
- )
- (command "redraw")
- (setvar "cmdecho" Old_Cmd)(princ)
- )
|