求助:多行文本的字高在程序中如何设置?
谢谢啦,等待中 <PRE class=Code>Sub Example_AddMtext()' This example creates an MText object in model space.
Dim MTextObj As AcadMText
Dim corner(0 To 2) As Double
Dim width As Double
Dim text As String
corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
width = 10
text = "This is the text String for the mtext Object"
' Creates the mtext Object
Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
ZoomAll
End Sub</PRE><PRE class=Code>这程序里也没有设置字高的?</PRE> <P>Sub Example_Height()<BR> ' This example creates a text object in model space.<BR> ' It then changes the height of the text object.</P>
<P> Dim textObj As AcadText<BR> Dim textString As String<BR> Dim insertionPoint(0 To 2) As Double<BR> Dim height As Double<BR> <BR> ' Define the text object<BR> textString = "Hello, World."<BR> insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0<BR> height = 0.5<BR> <BR> ' Create the text object in model space<BR> Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)<BR> ZoomAll<BR> MsgBox "The text height is " & textObj.height, vbInformation, "Height Example"<BR> <BR> ' Change the value of the Height to 1<BR> textObj.<FONT color=#0938f7><STRONG>height</STRONG></FONT> = 6<BR> textObj.Update<BR> MsgBox "The text height is set to " & textObj.height, vbInformation, "Height Example"<BR> <BR>End Sub</P> 谢谢大哥回复,你写的是单行文本的高度设置,我现在只能用MTEXT,因为我在做引线标注,引线标注里面只识别多行文本,希望得到解答,多行文本的高度设置? <P>Sub Example_AddMtext()<BR> ' This example creates an MText object in model space.<BR> <BR> Dim MTextObj As AcadMText<BR> Dim corner(0 To 2) As Double<BR> Dim width As Double<BR> Dim text As String<BR> corner(0) = 0#: corner(1) = 10#: corner(2) = 0#<BR> width = 10<BR> text = "This is the text String for the mtext Object"</P>
<P> ' Creates the mtext Object<BR> Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)<BR> <FONT color=#f70909><STRONG>MTextObj.Height = 20</STRONG></FONT><BR> ZoomAll<BR> <BR>End Sub</P> 好用,谢谢楼上兄台,结帖
页:
[1]