Hi buddies,
Need one hlp...I want to add "P=" infront of every numbers ..Is there any easy with rather than editing one by one??
Solved! Go to Solution.
Solved by Alfred.NESWADBA. Go to Solution.
Hi,
>> I want to add "P=" infront of every numbers
Are these numbers part of an attribute inside a block or text or mtext objects or part of application objects?
Search and replace does not work, but when we know what you have (or you upload a dwg-file) it could help to get valid suggestions.
- alfred -
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 -
Hi,
thank you for your feedback!
Just saw that my code does not filter to only text objects on a specific layer. Let me know if you need that change build in!
- alfred -
Can't find what you're looking for? Ask the community or share your knowledge.