请问:用VBA怎样使单行文字(即AddLine)的对齐分式为居中!!请高手帮忙!!
<P>请问:用VBA怎样使单行文字(即AddLine)的对齐分式为居中!!请高手帮忙!!</P><P>例如:Dim mytxt As AcadTextStyle '定义mytxt变量为文本样式<BR>Set mytxt = ThisDrawing.TextStyles.Add("mytxt") '添加mytxt样式<BR>mytxt.fontFile = "c:\windows\fonts\SIMKAI.TTF" '设置字体文件为楷体<BR>mytxt.ObliqueAngle = ThisDrawing.Utility.AngleToReal(0, 0) '设置字体角度为0<BR>ThisDrawing.ActiveTextStyle = mytxt '将当前文字样式设置为mytxt</P>
<P>call ThisDrawing.ModelSpace.addtext("hello",p,5) '写单行文字hello</P>
<P>hello是以p点左对齐的。</P>
<P>请问:怎样使hello以p点居中?</P>
<P>请各位仁兄帮忙!!!非常感谢!!!</P> AddLine 应为 Addtext ! 请帮忙!!!感谢!!!! <P>dim txt</P>
<P>set txt=ThisDrawing.ModelSpace.addtext("hello",p,5)</P>
<P>txt.Alignment = acAlignmentMiddleCenter<BR>txt.TextAlignmentPoint = p</P> 非常感谢!!!
页:
[1]