Hi,
if you don't have AutoCAD VBA-Enabler installed then please download and install it from >>>here<<<
Load the attached DVB file, then start command _VBARUN and select "...addTextPrefix" in the list ==> Run.
This is the code inside the DVB (no error handling)
Public Sub addTextPrefix()
Const newPrefix = "P="
Dim tLayName As String: tLayName = "number"
Dim tEnt As AcadEntity
Dim tTxt As AcadText
For Each tEnt In ThisDrawing.ModelSpace
If TypeOf tEnt Is AcadText Then
Set tTxt = tEnt
If Not (Left(tTxt.TextString, Len(newPrefix)) = newPrefix) Then
tTxt.TextString = newPrefix & tTxt.TextString
End If
End If
Next
End Sub
- alfred -
------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ...
blog.ish-solutions.at ...
LinkedIn ...
CDay 2026------------------------------------------------------------------------------------
(not an Autodesk consultant)