tfyyf 发表于 2003-3-14 18:12:00

如何用程序实现多文本换行?(在线等待,谢谢!!)

我想用VB在CAD中写多文本,可不知怎么换行,在CAD中实现如下:
12345
6789

用以下代码,可不行,请问各位高手如何解决?谢谢!!!!


Dim MtextObj As AcadMText
Dim MtextString As String
Dim InsertPoint(0 To 2) As Double
Dim Width As Double
Width = 45
InsertPoint(0) = 50: InsertPoint(1) = 20: InsertPoint(2) = 0
MtextString = ""
MtextString = MtextString & "012345" + Chr(13) + Chr(10)
MtextString = MtextString & "6789"
AcadApp.ActiveDocument.ActiveTextStyle.fontFile = "c:/windows/fonts/simsun.ttf"
Set MtextObj = AcadApp.ActiveDocument.ModelSpace.AddMText(InsertPoint, Width, MtextString)

mccad 发表于 2003-3-14 18:56:00

请查看以下二次开发栏目的文章

http://www.mjtd.com/a2/list.asp?id=107
页: [1]
查看完整版本: 如何用程序实现多文本换行?(在线等待,谢谢!!)