+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26
  1. #1
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Jun 2007
    Posts
    7

    Default Find & Replace Text

    Registered forum members do not see this ad.

    Hi There,
    Would like some help on a small problem that i have. I am trying to do a batch 'Find and Replace' exercise on a batch of autocad drgs. ie i need a program of some sort that will open a drawing, find a series of text strings and replace them with another series text strings and then save and close the drg.

    old text string could be say 537:00089 and new text string would be 537D:0032. There could be dozens/hundreds of numbers within a drg.

    Any ideas?

  2. #2
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    Windows 7 Professional
    Computer:
    Dell
    CPU:
    Intel Xeon E5-1603@2,80GHz
    RAM:
    4GB
    Graphics:
    NVIDA Quadro K600
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2014
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,558

    Default

    it would be a relatively simple task for either LISP or VBA.

    Are you saying you have a list of numbers to look for and whenever anyone of them is found it is replaced?

    Will at least one of the numbers appear in every drawing or will it not occur in othes?

    Will the number appear on their own or will they be part of a text string?
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson
    "Everything in drafting is logical. Except what isn’t." - Gavin Guile. (from the Lightbringer series of books by Brent Weeks)

    Dave

  3. #3
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-4770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2015
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,935

    Exclamation

    Quote Originally Posted by drewd1508 View Post
    Hi There,
    Would like some help on a small problem that i have. I am trying to do a batch 'Find and Replace' exercise on a batch of autocad drgs. ie i need a program of some sort that will open a drawing, find a series of text strings and replace them with another series text strings and then save and close the drg.

    old text string could be say 537:00089 and new text string would be 537D:0032. There could be dozens/hundreds of numbers within a drg.

    Any ideas?
    ToolPac has a routine to do this. I have used it several times with success.

  4. #4
    Senior Member borgunit's Avatar
    Using
    Mechanical 2006
    Join Date
    May 2007
    Location
    Ohio USA
    Posts
    287

    Default

    If you are using vb, then create a selection set of all text and/or mtext and then cycle through each one and then use the Replace method in vb.
    AutoCAD Mechanical 2006
    XP PRO SP3
    http://mechcad-insider.blogspot.com/

  5. #5
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Jun 2007
    Posts
    7

    Default

    Hi

    I need to make it clear that it is not the same text change in 100 different drgs. it is up to 100 text changes within a single drg, ie 100 different text strings each text string being a different no. (Autocad 2007)

    Cheers

  6. #6
    Senior Member borgunit's Avatar
    Using
    Mechanical 2006
    Join Date
    May 2007
    Location
    Ohio USA
    Posts
    287

    Default

    It is possible. The code would just have to be written for your parameters. Still start with a selection of text, then cycle through and apply your test. What is it you want to change and how? (your if/then's)
    AutoCAD Mechanical 2006
    XP PRO SP3
    http://mechcad-insider.blogspot.com/

  7. #7
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Jun 2007
    Posts
    7

    Default

    I have series of schematic diagrams which have equipment shown on them ie valves/pumps etc. Next to each piece of equipment is a unique reference no eg '537:00989' inserted as dtext. This reference no has to be amended for each piece of equipment. I am trying to work out a quick way of identifying every ref no within a drg and then replacing each no with a new one.

  8. #8
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    Windows 7 Professional
    Computer:
    Dell
    CPU:
    Intel Xeon E5-1603@2,80GHz
    RAM:
    4GB
    Graphics:
    NVIDA Quadro K600
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2014
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,558

    Default

    are you asking for somebody to do it for you or are you looking for guidance on how to write a routine?
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson
    "Everything in drafting is logical. Except what isn’t." - Gavin Guile. (from the Lightbringer series of books by Brent Weeks)

    Dave

  9. #9
    Forum Newbie
    Using
    AutoCAD 2007
    Join Date
    Jun 2007
    Posts
    7

    Default

    Im looking for guidance on how to write a routine as i have no autolisp/vba knowledge!

  10. #10
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    Windows 7 Professional
    Computer:
    Dell
    CPU:
    Intel Xeon E5-1603@2,80GHz
    RAM:
    4GB
    Graphics:
    NVIDA Quadro K600
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2014
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,558

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by drewd1508 View Post
    .. as i have no autolisp/vba knowledge!
    probably leaves me out as I don't have time to do a good job.

    Before you start coding write out what you need to do in psudo code. Something like...


    create a lookup table of search text/replace text
    get all text objects within drawing
    step through each piece of text
    if serch text is found, go to lookup table and replace
    when all text has been searched save drawing

    that can be expanded as you realise more steps are required
    both VBA and LISP are suitable for this sort of task but they can't (easilly) be mixed.
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson
    "Everything in drafting is logical. Except what isn’t." - Gavin Guile. (from the Lightbringer series of books by Brent Weeks)

    Dave

Similar Threads

  1. Script for find and replace
    By tim_allen81 in forum AutoCAD General
    Replies: 6
    Last Post: 27th Mar 2008, 02:49 am
  2. replace a block with a new one?
    By firsrate_caduser in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 29th Mar 2007, 10:15 am
  3. is there a replace command?
    By gib65 in forum AutoCAD Drawing Management & Output
    Replies: 8
    Last Post: 28th Jan 2007, 10:33 am
  4. Can't find DCL control code for text size...
    By LSR in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 14th Nov 2006, 10:09 pm
  5. Cannot Find Shell Program (text error)
    By fabriciofontolan in forum AutoCAD Drawing Management & Output
    Replies: 4
    Last Post: 6th Aug 2003, 02:09 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts