TextString property example


Sub TextString_Example()
    ' This example creates text and adds it to the drawing using the
    ' AddText method. It then returns the TextString in a message box.
    Dim sText As String: sText = "Test string for the AddText method"
    sText = InputBox("Type some text here:")
    Dim insPt(0 To 2) As Double: insPt(0) = 0: insPt(1) = 9: insPt(2) = 0:
    Dim dHeight As Double: dHeight = 5
    ' Add the Text object
    Dim oText As AcadText
    Set oText = ThisDrawing.ModelSpace.AddText(sText, insPt, height)
    ThisDrawing.Application.ZoomExtents
    MsgBox "The text you entered is: " & oText.TextString
End Sub

© Bricsys NV. All rights reserved.