本帖最后由 gaics 于 2020-8-12 19:21 编辑
- (defun c:tt (/ a b c d e err)
- (vl-load-com)
- (setvar "cmdecho" 0)
- (command "undo" "be")
- (vlax-for x (vla-get-textstyles
- (vla-get-activedocument (vlax-get-acad-object))
- )
- (vla-getfont x 'a 'b 'c 'd 'e)
- (if (= a "")
- (progn
- (if (and (not (findfile (vla-get-fontfile x)))
- (not (findfile (strcat (vla-get-fontfile x) ".shx")))
- )
- (vla-put-fontfile x "hzasc.shx")
- )
- (if
- (and (/= (vla-get-bigfontfile x) "")
- (not (findfile (vla-get-bigfontfile x)))
- (not (findfile (strcat (vla-get-bigfontfile x) ".shx")))
- )
- (vla-put-bigfontfile x "hztxt.shx")
- )
- )
- (progn (setq
- err (vl-catch-all-apply 'vla-setfont (list x a b c d e))
- )
- (if (vl-catch-all-error-p err)
- (vla-setfont x "仿宋" b c d e)
- )
- )
- )
- )
- (command "undo" "e")
- (princ)
- )
|