加入尺寸类型选择,执行代码
<p>路过的高手,帮帮忙啊!这个程序谁能帮忙<strong>加个尺寸类型</strong>的选择啊,</p><p><font face="Verdana">;;;修改属性值<br/>(defun c:SZ (/ e1) <br/>(setvar "cmdecho" 0)(setvar "pickbox" 21)<br/>(setq e1 (entget (car (setq s1 (entsel "选择编辑对象:")))))<br/>(if (= (cdr (assoc 0 e1)) "TEXT") (command "DDEDIT" s1))</font></p>
<p><font face="Verdana">(if (= (cdr (assoc 0 e1)) "MTEXT") (command "DDEDIT" s1))<br/>(if (= (cdr (assoc 0 e1)) "INSERT") (command "DDATTE" s1))(princ))</font></p>
<p><font face="Verdana"> </p>
<p>就是说如果我选择的类型是“尺寸”哦: <font face="Verdana">'((0 . "DIMENSION")) , </font>那么我就执行以下这些代码:</p>
<p><font face="Verdana">(defun TDZ (/ nqz nhz QZ HZ )<br/>(SETQ DS (getstring (strcat "\n 输入替代值:" )))<br/>(if (= DS nil ) (command "dim1" "new" (strcat DS "<>{}{}") e1 ""))<br/>(if (/= DS nil ) (command "dim1" "new" (strcat DS "{}{}") e1 ""))<br/>(princ))</font></p>
<p><br/></font> </p>
<p> </p> <p><font face="Verdana">(defun c:SZ (/ e1)<br/> (setvar "cmdecho" 0)<br/> (setvar "pickbox" 21)<br/> (setq e1 (entget (car (setq s1 (entsel "选择编辑对象:")))))<br/> (if (= (cdr (assoc 0 e1)) "TEXT")<br/> (command "DDEDIT" s1)<br/> )</font></p>
<p><font face="Verdana"> (if (= (cdr (assoc 0 e1)) "MTEXT")<br/> (command "DDEDIT" s1)<br/> )<br/> (if (= (cdr (assoc 0 e1)) "INSERT")<br/> (command "DDATTE" s1)<br/> )<br/> (if (= (cdr (assoc 0 e1)) "DIMENSION")<br/> (TDZ)<br/> )<br/> (princ)<br/>)</font></p> <p><strong>谢谢啦</strong></p>
<p> </p> 淡定淡定淡淡的
页:
[1]