How do I send a text string to microstation and get the text onto multiple lines as one text element? I have tried using the chr function to place a line break in the text string. The text will show up something like this when first created "Line1*Line2". If I go to edit the text to see what happened to the text and then do nothing other than look at it and then close the text editor the text will then wrap the text to the second line. Any ideas?
field$ = LineArray(3) textstring$ = "" Do While (InStr(1, field$, "~Chr(10)~") > 0) textstring$ = textstring$ + Left$(field$, InStr(1, field$, "~Chr(10)~") - 2) + Chr$(10) field$ = Right$(field$, Len(field$) - InStr(1, field$, "~Chr(10)~") - 9) Loop field$ = textstring$ + field$ Set tEl = CreateTextElement1(Nothing, field$, point, Matrix3dIdentity)
Hi, use TextNodeElement instead. The difference between a TextElement and a TextNodeElement is that a text element comprises a single line of text, while a text node element can comprise multiple lines of text. A text node element is a ComplexElement whose sub-elements are text elements.
Dim tn As TextNodeElement Set tn = CreateTextNodeElement2(Nothing, Point3dZero, Matrix3dIdentity, False) tn.AddTextLine "Hello" tn.AddTextLine "World" ActiveModelReference.AddElement tn tn.Redraw
HTH