dchlmz
发表于 2006-5-9 15:00:00
<P>这幅图上的文字是垂直排列的单行文字。</P>
<P>可我就是不知道怎么做?</P>
<P> </P>
dchlmz
发表于 2006-5-9 15:01:00
<P>这幅图上的文字是垂直排列的单行文字。</P>
<P>可我就是不知道怎么做?</P>
dchlmz
发表于 2006-5-9 15:04:00
<P>图已经上传,如何用VBA实现单行文字垂直排列?</P>
<P>请各位高手帮忙,不胜感激。</P>
xinghesnak
发表于 2006-5-9 15:47:00
<P>问题已解决,应做如下设置</P>
<P>aa.StyleName = "Style-等线体(标准) V"</P>
<P>我没试出来是自己没用到过,楼主见谅啊。。。。。^_^</P>
dchlmz
发表于 2006-5-9 15:49:00
忘了上传形字体
dchlmz
发表于 2006-5-9 15:52:00
<P>忘了上传形字体</P>
<P></P>
<P>该怎么设置呀</P>
<P>aa.StyleName = "Style-等线体(标准) V"</P>
<P>aa是什么呀</P>
<P> </P>
<P> </P>
xinghesnak
发表于 2006-5-9 15:56:00
<P>Sub main()<BR>Dim aa As Object<BR>Set aa = ThisDrawing.ModelSpace.Item(0)<BR>aa.StyleName = "Style-等线体(标准) V"<BR>End Sub</P>
<P> </P>
dchlmz
发表于 2006-5-9 16:08:00
<P>不行呀,显示不支持该方法aa.StyleName = "Style-等线体(标准) V"<BR></P>
<P> </P>
xinghesnak
发表于 2006-5-9 16:25:00
aa得到的是acadblock,你的程序是这样写的吗?
dchlmz
发表于 2006-5-9 16:33:00
<P>不是,我是新建图形,在原图中调用"Style-等线体(标准) V"字型,肯定能让字垂直排列。</P>
<P>我的源程序如下:请指正。</P>
<P>Sub main()<BR> Dim tsObj As AcadTextStyle<BR> Dim textobj As AcadText<BR> Dim textString As String<BR> Dim insPnt(0 To 2) As Double<BR> Dim agnPnt(0 To 2) As Double<BR> Dim Height As Double<BR> <BR> Set tsObj = ThisDrawing.TextStyles.Add("Style-等线体(标准) V")<BR> ThisDrawing.ActiveTextStyle = tsObj<BR> <BR> FontsName = "C:\AutoCAD 2002\Fonts\等线体(标准).shx"<BR> ThisDrawing.ActiveTextStyle.fontFile = FontsName<BR> <BR> FontsName = "C:\AutoCAD 2002\Fonts\等线体(标准)big.shx"<BR> ThisDrawing.ActiveTextStyle.BigFontFile = FontsName<BR> <BR> Height = 1.5<BR> tsObj.Width = 1<BR> textString = "中华人民共和国"<BR> <BR> 'textobj.StyleName = "Style-等线体(标准) V"<BR> <BR> insPnt(0) = 100: insPnt(1) = 50: insPnt(2) = 0<BR> Set textobj = ThisDrawing.ModelSpace.AddText(textString, insPnt, Height)<BR> 'textobj.Alignment = acAlignmentAligned<BR> 'textobj.VerticalAlignment = acVerticalAlignmentTop<BR> 'textobj.TextAlignmentPoint = insPnt<BR> <BR> <BR> ThisDrawing.Application.Update '更新数据<BR> ThisDrawing.Application.ZoomExtents '全窗口</P>
<P>End Sub</P>