我有个程序代码如下:
(defun c:TQ (/ ifdimt BL SS SS1 )
(setvar "cmdecho" 0) (setq scal (getvar "dimscale")) (setq qz "1:") (setq BL (getstring (strcat "\n请确认或输入图幅比例值 (默认值<" (rtos scal 2) ">):"))) (if (NULL BL)(setq BL (getvar "dimscale"))) (if (= BL nil ) (setq BL scal inspoint (getpoint "\n请指定放置点: "))) (setq TBL (strcat qz BL ))(if (NULL qz)(setq qz (getvar "dimscale"))) (command "mtext" x2 "j" "TL" "@-70,12" TBL "" "EXPLODE" (ENTLAST)) (command "osnap" "end,mid,int,NOD,INS,cen,per,TAN,NEA,QUI,APP,EXT,PAR");捕捉全部 (setq ss (ssget))(if (NULL SS)(EXIT)) (command "_cutclip" ss "" "_pasteblock" "SCALE" scal inspoint ) (princ))
现在就是想要实现 当出现提示"\n请确认或输入图幅比例值 (默认值<" (rtos scal 2) ">):" 时,
如果我此时直接回车或空格,那么"mtext" 文字写出来是 1:"(默认值<" (rtos scal 2) ">)", 缩放时scal用默认值;
如果我此时输入其它数据,那么"mtext" 文字写出来是 1:"输入值", 缩放时scal用输入值;
望高手赐教 |