Hello everyone,
Is it possible to create bulleted/numbered text using VBA? I assume all I need to know is the correct syntax for the text string.
I can usually figure out Autocad text markup syntax by simply creating the text I want in regular Autocad; then hovering over the 'contents'-property in the properties pallette. But for numbered text, somewhere on the line a square □ symbol or something similar is added, which is a symbol I am unable to use in the VBA editor.
As an example, to create this text:
the code looks like this:
\pxi-3,l3,t3;1.□wowee\P2.□zowee
Also, is there any good resource on Autocad text code syntax in general?
Solved! Go to Solution.
Solved by kasperwuyts. Go to Solution.
I have solved this issue. In case anyone should have the same problem for numbered text. Use the vbTab constant to add a tab to a string. This seems to have been the missing symbol, indicated by the square. To draw the example in my opening post, the code should look like this:
Sub DrawNumberedText()
Dim mtextObj As AcadMText
Dim insertPoint As Variant
Dim textString As String
Dim width As Double
insertPoint = ThisDrawing.Utility.GetPoint(, "Specify insertion point")
width = 100
textString = "1." & vbTab & "wowee\P2." & vbTab & "zowee"
Set mtextObj = ThisDrawing.ModelSpace.AddMText(insertPoint, width, textString)
End Sub
I still don't know a good resource for text syntax in Autocad or what it is based on, so many kudos still to be had for people who suggest some good sources.