- 积分
- 2493
- 明经币
- 个
- 注册时间
- 2006-10-1
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2020-8-17 23:19:11
|
显示全部楼层
运行命令提示:命令: G6
文字样式 standard,txt.shx,&万能字体.shx 已存在
然后请教大神,如何输入命令后,直接切换到设置好的参数呢
(defun C:G6()
(G6 "standard" "txt.shx" "&万能字体.shx" )
)
(defun G6(standard txt.shx &万能字体.shx / obj)
;(vl-cmdf "undo" "be")
(if (not (tblsearch "style" standard))
(progn
(setq obj (vla-add (vla-get-TextStyles (vla-get-ActiveDocument (vlax-get-acad-object))) standard))
(vlax-dump-Object obj)
(if &万能字体.shx
(progn ;qr[q3_2006],qq1434177703,2020/8/6
(vla-put-fontfile obj txt.shx)
(vla-put-BigFontFile obj &万能字体.shx)
)
(progn
(setq &万能字体.shx "")
(vla-setFont obj txt.shx :vlax-false :vlax-false 134 2)
)
)
(vla-put-Height obj 500) ;设置字高
(vla-put-Width obj 1) ;设置宽度因子
(vla-put-ActiveTextStyle (vla-get-ActiveDocument (vlax-get-acad-object)) obj) ;设置为当前字体样式
(vl-cmdf "purge" "st" "*" "n" "_regen") ;删除其它文字样式
(princ (strcat "\n 文字样式 " standard "," txt.shx ","&万能字体.shx " 已建立并置为当前") )
)
(progn
(if (not &万能字体.shx)(setq gbcbig.shx ""))
(princ (strcat "\n 文字样式 " standard "," txt.shx ","&万能字体.shx " 已存在") )
)
)
;(vl-cmdf "undo" "e")
(setq standard nil txt.shx nil &万能字体.shx nil obj nil)
(princ)) |
|