The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 AutoCAD
 Lisp & Other Handy Files
 Search & Replace Mtext within a block
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cswancott
New Member

United Kingdom
10 Posts

Posted - February 17 2006 :  04:58:24 AM  Show Profile  Visit cswancott's Homepage  Reply with Quote
Does anyone know how to search & replace Mtext within a block, I have tried both the normal & mtext searchs together, but does not seem to work on mtext within a block. Perhaps I am just doing it wrong.

It would also be useful to specify a specific block by name to search, as this would speed up the processing no end.

I have searched the web & other threads but can not seem to find anything relating to Mtext within blocks, perhaps its just not working because the blocks are in paperspace?

Any help would be much appreciated.

Craig.

Admin
Administrator



652 Posts

Posted - February 17 2006 :  07:51:32 AM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hi cswancott,

I've taken a look around, and have run into the same wall... I can't find what you need. There are many routines to Search and Replace MTEXT, but not when it is embedded in a block.

You could also possibly request it in the AutoDesk discussion forum. I would bet there is something somewhere that can help.
(Have you lurked around in here... http://groups.google.com/groups?q=autocad )?



In the meantime, I actually found something I've been looking for on a similar note.

Download Attachment: fixtext.zip
1.29 KB

This lisp will perform MTEXT search and replace (using lisp), (Currently Hurricane's built-in Wizard generates code that only uses VBA)

Unfortunately, after testing the above it doesn't Search and Replace MTEXT that is in a BLOCK . I suppose "explode"ing, or "burst"ing is out of the question in your case??

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

cswancott
New Member

United Kingdom
10 Posts

Posted - February 17 2006 :  08:48:23 AM  Show Profile  Visit cswancott's Homepage  Reply with Quote
Many thanks for your help.

I did think about exploding the blocks, but unfortunately I am unble to, We work like an agency, and our clients are very particular about their drawings, the blocks are generated autmatically by a program (Codebook), and I have asked if it can be changed to create the text as attributes, this would make a lot more sense, but I will just have to work with what I have got for the moment.

I suppose it may be possible to explode, edit & then recreate block, as I know it is a specific named block in each drawing. Will post on Autodesk website and let you know if I get any answers.

Many thanks for the Lisp routine, I will have a play with it.

Regards,

Craig

Go to Top of Page

cswancott
New Member

United Kingdom
10 Posts

Posted - February 22 2006 :  12:05:05 PM  Show Profile  Visit cswancott's Homepage  Reply with Quote
Have managed to get what I needed, this lisp enables me to search for specific string & replace within a specific block by name (the titleblock), as different drawings have similar blocks with different names I have just doubled the code and marked it up accordingly.

This lisp should work on all drawings which are currently open & also when scripted using SDI=1, single drawing at a time.

Hope this helps someone else too.

Download Attachment: RBS.zip
1.13 KB
Go to Top of Page

Admin
Administrator



652 Posts

Posted - February 22 2006 :  5:19:15 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Thanks Craig,

That is great! We all need more stuff like that!
(Hey... I just had and idea... Maybe a "Post your Favourite lisps" thread could drum up some more sharing of lisp routines)

We all appretiate the follow up!

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

cswancott
New Member

United Kingdom
10 Posts

Posted - February 23 2006 :  03:27:05 AM  Show Profile  Visit cswancott's Homepage  Reply with Quote
I tried to repost this last night but it obviously never worked, I have attached the Lisp routine which includes prompts for the Block name & search/replace text. This is much easier to script as you can just run a number of times within the script changing the prompt responses for any variations without having to change the lisp.

Much better I think.


Download Attachment: RBS2.zip
930 Bytes
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.31 seconds. Snitz Forums 2000