- 积分
- 10670
- 明经币
- 个
- 注册时间
- 2018-8-12
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
批量改字高与字宽,支持多行文本、单行文字、属性字。
快捷键 TT1 批量改字高
快捷键 TT2 批量改字宽
请大师看看怎么弄才能支持多行文本的字宽也可以改
(defun ch_dxf(en num ch / old_num new_num ent)
(if (setq ent (entget en)
new_num (cons num ch)
old_num (assoc num ent))
(entmod(subst new_num old_num ent))
(entmod(reverse(cons new_num (reverse ent))))))
(defun c:tt1( / ss n x ww)
(setq ss (ssget '((0 . "text,mtext,attdef"))))
(setq ww (getreal "请输入字高:"))
(repeat (setq N (sslength SS))
(apply '(lambda (x) (ch_dxf x 40 ww))
(list (ssname SS (setq N (1- N))))))
(princ))
(defun c:tt2( / ss n x ww)
(setq ss (ssget '((0 . "text,mtext,attdef"))))
(setq ww (getreal "请输入字宽:"))
(repeat (setq N (sslength SS))
(apply '(lambda (x) (ch_dxf x 41 ww))
(list (ssname SS (setq N (1- N))))))
(princ))
|
|