iamhuangjinming 发表于 2019-5-3 10:36:48

求助~把文字高度放大1.25倍。怎么修改可以只输一次ttt,连续对不同对象操作呢?

(defun C:ttt ()

(princ "\n 选择源:")
(setq e (ssget "_+.:E:S" '((0 . "*TEXT,*DIMENSION"))))
   (setq e (ssname e 0))
   (setq en (entget e))
            (setq TextW (cdr (assoc 40 en)))
(princ TextW)
(setq TextW (/ TextW 0.8))
(princ TextW)
(setq h40 (cons 40 TextW))
(setq b (assoc '0 en))      
(setq b (cdr b))      
(if (= b "TEXT")
(progn      
(setq h (assoc '40 en))      
(setq en (subst h40 h en))      
(entmod en)    (princ)   
)      ))

Andyhon 发表于 2019-5-3 11:36:30

Try this:

(defun C:ttt ()

   (princ "\n 选择源:")
   (while (setq e (ssget "_+.:E:S" '((0 . "*TEXT,*DIMENSION"))))
   (setq e (ssname e 0))
   (setq en (entget e))
   (setq TextW (cdr (assoc 40 en)))
   (princ TextW)
   (setq TextW (/ TextW 0.8))
   (princ TextW)
   (setq h40 (cons 40 TextW))
   (setq b (assoc '0 en))
   (setq b (cdr b))
   (if (= b "TEXT")
       (progn
         (setq h (assoc '40 en))
         (setq en (subst h40 h en))
         (entmod en)
         (princ)
   ) ) )
)

taoyi0727 发表于 2019-5-3 11:54:15

本帖最后由 taoyi0727 于 2019-5-3 12:07 编辑


[*]

[*];文字批量缩放
[*](defun c:tt (/ en n ss textw)
[*](princ "\n 选择源:")
[*](while (setq ss (ssget '((0 . "*TEXT"))))
[*]    (repeat (setq n (sslength ss))
[*]      (setq en (entget (ssname ss (setq n (1- n)))));每个文字
[*]      (setq TextW (cdr (assoc 40 en)));文字高度
[*]      (setq TextW (/ TextW 0.8));计算新文字高度
[*]      (entmod (subst (cons 40 TextW) (assoc 40 en) en));更新组码
[*]    )
[*])
[*](princ)
[*])

iamhuangjinming 发表于 2019-5-3 22:37:18

taoyi0727 发表于 2019-5-3 11:54
[*]

[*];文字批量缩放


感谢感谢感谢感谢~

iamhuangjinming 发表于 2019-5-3 22:37:39

Andyhon 发表于 2019-5-3 11:36
Try this:

(defun C:ttt ()


Thank you very much~
页: [1]
查看完整版本: 求助~把文字高度放大1.25倍。怎么修改可以只输一次ttt,连续对不同对象操作呢?