Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Numbering

yogeshnairvarkala
Enthusiast

Numbering

yogeshnairvarkala
Enthusiast
Enthusiast

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??P adding.JPG

0 Likes
Reply
Accepted solutions (1)
617 Views
5 Replies
Replies (5)

Alfred.NESWADBA
Consultant
Consultant

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes

yogeshnairvarkala
Enthusiast
Enthusiast

It's  part of text  am attaching the drawing if u can hlp pls

0 Likes

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

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 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes

yogeshnairvarkala
Enthusiast
Enthusiast

vowwww .it wrks like a charm tks alot 🙂

0 Likes

Alfred.NESWADBA
Consultant
Consultant

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)