Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Numbering

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
yogeshnairvarkala
514 Views, 5 Replies

Numbering

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

5 REPLIES 5
Message 2 of 6

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

(not an Autodesk consultant)
Message 3 of 6

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

Message 4 of 6

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

(not an Autodesk consultant)
Message 5 of 6

vowwww .it wrks like a charm tks alot 🙂

Message 6 of 6

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

(not an Autodesk consultant)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report