lisp修改天正标高值_【求教】如何批量修改天正字体

38e3ff67093bbd6280bf4268ad066240.gif

2015年12月15日 09:15:31

10楼

(princ "\n命令:tx 改变字体文件!")

(defun c:tx (/ acaddocument tstyle textitem textcont seltext i textsel

texti)

(vl-load-com)

(setq acaddocument (vla-get-activedocument (vlax-get-acad-object)))

(setq tstyle (vla-get-textstyles acaddocument))

(vla-add tstyle "CXB_txt")

(setq textitem (vla-item tstyle "CXB_txt"))

(vla-put-fontfile textitem "gbenor.shx") ;"romans.shx"

(vla-put-bigfontfile textitem "GBCBIG.shx") ;"hztc2.shx"

(vla-put-width textitem 1)

(vla-put-height textitem 0.0)

(prompt "\n点选需转换的字体:")

(setq seltext (vlax-ename->vla-object (car (entsel))))

(setq selstyle (vla-get-stylename seltext))

(if (wcmatch selstyle "[@#]*")

(progn

(setq selstyle (strcat "[@#]" (substr selstyle 2)))

;;;(vla-put-stylename (vla-item tstyle (vla-get-stylename seltext)) selstyle )

))

(setq textsel

(ssget "_x" (list (cons 0 "TEXT,ATTDEF") (cons 7 selstyle)))

)

(setq i 0)

(repeat (sslength textsel)

(setq texti (vlax-ename->vla-object (ssname textsel i)))

(vla-put-stylename texti "CXB_txt")

(vla-put-scalefactor texti 1)

;;; (vla-put-height

;;; texti

;;; (* 100 (fix (/ (vla-get-height texti) 100)))

;;; )

;;; (if (= (vla-get-height texti) 200)

;;; (vla-put-height texti 300)

;;; )

(setq i (1+ i))

)

;;(vla-regen acadDocument acallViewports)

(vla-regen acadDocument :vlax-true)

(princ)

)

回复

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值