[求助]vb下定义文字宽度比例问题,大家多帮忙
我在vb6.0sp6中定义cad的文字宽度比例时,发现文字依然宽度比例为1,请问为什么那位高手给我指点以下,代码如下:<BR>Dim wenzileixing As AcadTextStyle<BR>Dim ziti As String<BR>Dim charset As Long<BR>Dim pitchandfamily As Long<BR>Set wenzileixing = cad.ActiveDocument.TextStyles.Add("wntext")
<BR>wenzileixing.Width = 0.7 <FONT color=#ff0000>这样定义对不对?????????</FONT>
<BR>wenzileixing.fontFile = 字体
wenzileixing.BigFontFile = 字体
Dim wenzi As AcadText<BR>Dim wenzishi As String<BR>Dim weizhi(0 To 2) As Double<BR>Dim gaodu As Double<BR>wenzishi = "我爱中华人民共和国"<BR>gaodu = 4<BR>weizhi(0) = 50<BR>weizhi(1) = 50<BR>weizhi(2) = 0<BR>cad.ActiveDocument.ActiveTextStyle = wenzileixing<BR>Set wenzi = cad.ActiveDocument.ModelSpace.AddText(wenzishi, weizhi, gaodu)<BR>wenzi.Update 各位哥哥,姐姐,大家多帮帮忙啊,我真的很急啊,在此谢谢了!!!!
多谢
多谢
多谢
多谢
多谢
多谢
多谢
多谢
多谢 使用文档对象的ActiveTextStyle属性,将你添加的文字样式设置为当前的文字样式。 你是指高宽比,是ScaleFactor 对,我大意了。
: ( 哈哈,多谢两位,请再说明白一些
还是我上面的例子
在vb中
wenzileixing没有ScaleFactor属性,只有wenzi 有
如果我把代码改写成
Dim wenzileixing As AcadTextStyle<BR>Dim ziti As String<BR>Dim charset As Long<BR>Dim pitchandfamily As Long<BR>Set wenzileixing = cad.ActiveDocument.TextStyles.Add("wntext")
<BR>wenzileixing.Width = 0.7 <FONT color=#ff0000>这样定义对不对?????????</FONT>
<BR>wenzileixing.fontFile = 字体
wenzileixing.BigFontFile = 字体
Dim wenzi As AcadText<BR>Dim wenzishi As String<BR>Dim weizhi(0 To 2) As Double<BR>Dim gaodu As Double<BR>wenzishi = "我爱中华人民共和国"<BR>gaodu = 4<BR>weizhi(0) = 50<BR>weizhi(1) = 50<BR>weizhi(2) = 0<BR>cad.ActiveDocument.ActiveTextStyle = wenzileixing
wenzi.ScaleFactor=0.7 请注意这里<BR>Set wenzi = cad.ActiveDocument.ModelSpace.AddText(wenzishi, weizhi, gaodu)<BR>wenzi.Update
那么提示错误,请问谁能给我个例子,比如我想让高宽比为0.7,到底该怎么写呢,谢谢谢谢 试着改写一下:
Sub test()<BR> Dim wenzileixing As AcadTextStyle<BR> Set wenzileixing = ThisDrawing.TextStyles.Add("wntext")<BR> wenzileixing.SetFont "ËÎÌå", False, False, 1, 1
wenzileixing.Width = 0.7 ' 这样定义对了!!!!
Dim wenzi As AcadText<BR> Dim wenzishi As String<BR> Dim weizhi(0 To 2) As Double<BR> Dim gaodu As Double<BR> wenzishi = "我爱中华人民共和国"<BR> gaodu = 4<BR> weizhi(0) = 50<BR> weizhi(1) = 50<BR> weizhi(2) = 0<BR> ThisDrawing.ActiveTextStyle = wenzileixing<BR> Set wenzi = ThisDrawing.ModelSpace.AddText(wenzishi, weizhi, gaodu)<BR> wenzi.Update<BR>End Sub<BR>
页:
[1]