hdlyt11 发表于 2010-8-12 09:58:00

[求助]修改旋转文字角度源码

<p><font face="Verdana">(defun c:test1( / ent ents ang)<br/>&nbsp; (setq ent (car (nentsel)))<br/>&nbsp; (setq ents (entget ent))<br/>&nbsp; (setq ang (getangle "\n输入角度:"))<br/>&nbsp; (setq ents (subst (cons 50 ang) (assoc 50 ents) ents))<br/>&nbsp; (entmod ents)<br/>&nbsp; (entupd ent)<br/>&nbsp; (princ)<br/>) <br/></font></p>
<p><font size="6">怎样将上面这段源码中的点选改为框选?</font></p>

ljpnb 发表于 2010-8-12 12:54:00

<p><font face="Verdana">(defun c:test1 (/ ent ents ang)<br/>&nbsp; (princ "选择要修改的文字,可多选")<br/>&nbsp; (setq ss (ssget '((0 . "*TEXT"))))<br/>&nbsp; (setq ang (getangle "\n输入角度:"))<br/>&nbsp; (setq k 0)<br/>&nbsp; (repeat (sslength ss)<br/>&nbsp;&nbsp;&nbsp; (progn<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq ent (ssname ss k))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq ents (entget ent))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq ents (subst (cons 50 ang) (assoc 50 ents) ents))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (entmod ents)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (entupd ent)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq k (1+ k))<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; (princ)<br/>)</font></p>
<p><font face="Verdana"><br/></font>&nbsp;</p>

Ming131564 发表于 2023-1-5 11:49:39

2楼威武霸气,这么短的代码实现了

xyp1964 发表于 2023-1-6 20:55:37

(defun c:tt ()
(setq ang(Uangle 1 "" "角度<输入或鼠标直接量取>" ang nil))
(princ "选择要修改的文字: ")
(if (setq ss (ssget '((0 . "*TEXT"))))
    (xyp-SubUpd ss 50 ang)
)
(princ)
)
页: [1]
查看完整版本: [求助]修改旋转文字角度源码