[求助]文字样式的固定字高怎么改为0?(已解决)
www.dimcax.com
[求助]文字样式的固定字高怎么改为0?(已解决)
这个问题应该是一个老问题了,在论坛翻了很久没找到答案,请大家指点一下,谢谢。
如果用文字样式里的字高不为0,例如用(command "text" "0,0" "" "abc")会写不出文字,不知为什么。我弄了一个改字高为0的程序,有点麻烦,但遇到“宋体”,字体就会变成 问号,晕。程序如下:
(defun wenzhi (/ st)
(setvar "cmdecho" 0)
(setq st (tblsearch "style" (getvar "textstyle"))) ;;获得文字样式群码
(if (> (cdr (assoc 40 st)) 0) ;;如果字高不为0
(if (not (member (cdr (assoc 3 st)) '("italic.shx" "romand.shx" "simplex.shx" "syastro.shx")))
(command "-style" "" "" 0 "" "" "" "")
(command "-style" "" "" 0 "" "" "" "" "")
)
)
(princ)
)
请问有没有更好的方法?用变量textsize又改不了0
d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25;|******************************************************************************************;;;;;
[函数]: (gps->txt-styleheight-put textstyles height)
[说明]: 修改文字样式高度
[参数]:
[参数1]:
[参数2]:
[返回值]:
[成功]:
[失败]: nil
[示例]: (gps->txt-styleheight-put "standard" 0)
[备注]: 无
( rvalue( '(()
(vla-put-height
(vla-item
(vla-get-textstyles (vla-get-activedocument ()))
textstyles
)
height
)
)))
( ( rvalue) ( rvalue) rvalue);返回值
)
d
这个问题困扰了我很久,一来明经就解决了。十分感谢xshrimp !
(ps:“贱人工具箱”也存在这个问题)
d