The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 AutoCAD
 Lisp & Other Handy Files
 Search and Replace Text (in Attributes too)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Attach a File

Check here to subscribe to this topic.
   

T O P I C    R E V I E W
BK Posted - April 23 2003 : 1:34:25 PM
Here is a really good lisp routine by Thomas Berger.

It allows you to specify a string (partial strings DON'T need ? and * characters), and a replacement string, it searches the entire drawing and does the replacement.

So if you want to replace ROOF4-TILE with ROOF-TILE then just run GSR and enter ROOF4 at the first prompt, and ROOF at the second.

For those of you with lots of wrong text inside block attributes, this routine can be a lifesaver.

Download Attachment: GSRLSP.ZIP
2.8 KB

BK

10   L A T E S T    R E P L I E S    (Newest First)
anto1 Posted - November 16 2005 : 05:20:33 AM
hi, I made a short test and it works pretty good, thank you, and write again forum , its not a waste of time
anto1 Posted - November 14 2005 : 10:26:22 AM
hi sbubendorf, thanks for answering, im going to try it and post my results,
n/a Posted - November 11 2005 : 12:25:45 PM
Hi anto1:
Maybe I finally have something to contribute to this forum rather than always taking. Try this GSR lisp file. I think this will do what you want to do. If you compare this file to the previous one, you will see that I only had to add a "1" to two lines of the code. Anything ("a", "anto1", "steve"), etc. would have worked in place of the "1". Basically, if anything is added to that location in the "getstring" function, it tells AutoCAD to accept a space in the string. Hopefully that is what you wanted to accomplish. If not, I apologize for wasting your time.

Good luck.

Download Attachment: GSR.ZIP
2.21 KB
Admin Posted - November 11 2005 : 11:59:41 AM
Hi anto1,

I would think that the GSR lisp could be modified to do this, but I am no lisp expert.

I've looked around for another "Text Search and Replace" lisp to perform what you require, but unfortunately, nothing is coming up.

Maybe someone in here can modify GSR.LSP... I'm sure to the seasoned lisp programmer, this is an easy task.

Anyone?

Thanks,
Bill
anto1 Posted - November 11 2005 : 11:02:10 AM
Hello again,
do you know if I can search the text als "exact phrase" with the GSR routine ?
Thanks
Miksteele Posted - November 09 2005 : 12:09:19 PM
Hi anto1,

If you are wanting to update certain attributed blocks... it sounds like you need to be using the TITLE BLOCK UPDATE wizard. It works pretty slick. Just make sure you hit the CLEAR button and type in a template name before you start filling in the attribute fields and block name field.

Good Luck!
Admin Posted - November 09 2005 : 08:31:12 AM
Hi anto1,

Currently, to be able to specify which blocks to perform it on is not implemented... you have to perform it globally on each drawing, and you would use the "Search and Replace Text Wizard" found in the Wizards menu in Hurricane.

Make sure that you select "Process Blocks".

Hope this helps!

Regards,
Bill
anto1 Posted - November 09 2005 : 08:12:35 AM
Hi Bill
thank you, it wotks fine,
What I need to change in the script to do the same but besides the complete drawing just in one or more blocks?
Admin Posted - November 08 2005 : 10:37:04 AM
Hi anto1,

Here is how you would use the above lisp within a script to perform the above procedure...
(lisp location may vary)

; begin script
(LOAD "C:/PROGRAM FILES/AUTOCAD 2000I/SUPPORT/GSR.LSP")
GSR
ROOF4
ROOF
; end script


Hope this helps!

Regards,
Bill
anto1 Posted - November 08 2005 : 09:02:46 AM
Hi, BK,
I tried this routine and it is very good, do you know a script with the same function?

The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.12 seconds. Snitz Forums 2000