请帮忙合并这两个程序为一个
<p><font face="Verdana">;;;修改属性值<br/>(defun C:SZ ()(setvar "pickbox" 21)(command "DDATTE" )(princ))</font></p><p><font face="Verdana">;;;修改文字</font></p>
<p><font face="Verdana">(defun C:SW ()(setvar "pickbox" 21)(command "DDEDIT" )(princ))</font></p>
<p> </p>
<p>我只想达到这样的目的:</p>
<p> </p>
<p><font face="Verdana">(setq a (entsel "\n请选择需要编辑的实体:"))</font></p>
<p> </p>
<p>如果选择的对象为块,则(command "DDATTE" );</p>
<p> </p>
<p>如果选择的对象为块,则(command "DDATTE" );</p>
(defun c:tt ()
(setq en (car(entsel "\n请选择需要编辑的实体:")))
(setq entype (cdr (assoc 0 (entget en))))
(cond
((or(= entype "TEXT")(= entype "MTEXT"))
(command "DDEDIT"en "")
((= "INSERT" entype)
(command "DDATTE" en "")
)
(t
(alert "你选择的不是块和文本!")
)
)
)
)
<p>谢谢啦!</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))<br/>(if (= (cdr (assoc 0 e1)) "MTEXT") (command "DDEDIT" s1))<br/>(if (= (cdr (assoc 0 e1)) "INSERT") (command "DDATTE" s1))(princ))</font></p>
<p>我原以为是这样,不过你的还是很喜欢</p> <p>这个程序谁能帮忙加个尺寸类型的选择啊,就是说如果我选择的类型是“尺寸”: <font face="Verdana">'((0 . "DIMENSION")) </font></p>
<p>那么我就执行以下这些代码:</p>
<p><font face="Verdana">(defun TDZ (/ e1 ds)<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>路过高手,帮帮忙啊!</p> 淡定淡定淡定淡定
页:
[1]