引线标注
<P></P><P>这样的标注怎么用vba实现?</P> http://www.vba.cn/object/acad2004/idh_leader_object.htm <P>这个东东很好,谢谢啦,万分感谢,</P> <P>引线标注时末尾的注释用的是多行文本的形式,如何在程序中确定其字高呢?谢谢,头疼</P> <P>'创建引线标注<BR>Public Function AddLeader()<BR> ' This example creates a leader in model space.<BR> ' The leader is not attached to any annotation object<BR> ' in this example.<BR> <BR> Dim leaderObj As AcadLeader, MTextObj As AcadMText<BR> Dim points(0 To 8) As Double<BR> Dim leaderType As Integer<BR> Dim annotationObject As AcadObject<BR> Dim textString As String<BR> Dim insertionPoint(0 To 2) As Double<BR> Dim height As Double<BR> Dim width As Double<BR> dim str as string</P>
<P> str=100 <BR> ' Define the new MText object<BR> textString = "大概可能" & str<BR> insertionPoint(0) = 10: insertionPoint(1) = 13: insertionPoint(2) = 0</P>
<P>' height = 1.8<BR> width = 10<BR> ' Create the MText object in model space<BR> Set MTextObj = ThisDrawing.ModelSpace.AddMText(insertionPoint, width, textString)<BR> </P>
<P> <BR> points(0) = 0: points(1) = 0: points(2) = 0<BR> points(3) = 10: points(4) = 10: points(5) = 0<BR> points(6) = 11: points(7) = 10: points(8) = 0<BR> 'leaderType = acLineWithArrow<BR> leaderType = acLineNoArrow<BR> Set annotationObject = MTextObj<BR> <BR> ' Create the leader object in model space<BR> Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType)<BR> ZoomAll<BR> <BR>End Function<BR>这是我写的函数,高手看看怎么改变字高,默认是2.5</P>
<P>,改成1.8,</P> <P>我发现points(8)这个点组中,最后三位即6,7,8确定的点对引线标注没有影响,关键是怎么调整好多行文本的字高和字宽,还是希望能有办法调整这个字高,希望有高手给看看!</P> 可以在定义的时候就调整它的高度,height = 1.8<BR> width = 10<BR>就在这个里面定义,检查以下美观就OK了 谢谢,知道了,把多行文本字高设置一下MTextObj.height = 1.8,然后调整点的位置就可以满足要求
页:
[1]