894560869 发表于 2010-7-26 12:54:00

请帮忙合并这两个程序为一个

<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>&nbsp;</p>
<p>我只想达到这样的目的:</p>
<p>&nbsp;</p>
<p><font face="Verdana">(setq a (entsel "\n请选择需要编辑的实体:"))</font></p>
<p>&nbsp;</p>
<p>如果选择的对象为块,则(command "DDATTE" );</p>
<p>&nbsp;</p>
<p>如果选择的对象为块,则(command "DDATTE" );</p>

Gu_xl 发表于 2010-7-26 14:03:00


(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 "你选择的不是块和文本!")
)
)
)

)

894560869 发表于 2010-7-26 14:34:00

<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>

894560869 发表于 2010-10-10 21:29:00

<p>这个程序谁能帮忙加个尺寸类型的选择啊,就是说如果我选择的类型是“尺寸”:&nbsp; <font face="Verdana">'((0 . "DIMENSION"))&nbsp;&nbsp; </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 "&lt;&gt;{}{}") e1 ""))<br/>(if (/= DS nil ) (command "dim1" "new" (strcat DS "{}{}") e1 ""))<br/>(princ))</font></p>
<p>路过高手,帮帮忙啊!</p>

jslxt 发表于 2011-10-22 19:51:23

淡定淡定淡定淡定
页: [1]
查看完整版本: 请帮忙合并这两个程序为一个