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
 find and replace Mtext
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - October 23 2003 :  5:00:42 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Has anyone run into a "find and replace" FOR MTEXT

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com

Admin
Administrator



652 Posts

Posted - October 23 2003 :  5:26:16 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Yes! Actually, I was just preparing to release it...!!

(Are you watching me?) ;)

(I'm out of the office now), I will post it later on this evening with updated instructions... it's a VBA routine, but don't worry, it can be run from a script...

In Hurricane Something like this... (I'm going from memory)

;Start
-VBALOAD "$HurPath$LispMtext.dvb"
-VBARUN Mtext.SearchAndReplace
Search Text
Replace With Text
;End

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

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - October 23 2003 :  5:29:41 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Do you know is it's compatable with DTEXT also?

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Admin
Administrator



652 Posts

Posted - October 23 2003 :  5:50:14 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Just TEXT and MTEXT right now. I can work on it... but it won't be for tomorrow, that's for sure...

Doesn't the usual "Search and Replace" Wizard take care of Dimensional Text?? (Isn't that the same as DTEXT?... Sorry, I'm ignorant to those features... Something else to learn!)

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

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - October 23 2003 :  6:00:32 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Yes... the REPTEXT.LSP does handle dtext just fine...I guess I was getting way ahead of myself

Sometimes I don't know whether I am going to be changing dtext or mtext...most of the time its both!

If it handles dtext and mtext it will probably just replace my use of REPTEXT.LSP

No rush Bill I've been searching for an mtext "search and replace" for a while. I can wait a little longer

Everything I have found at this point I didnt like...unscriptable





Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Admin
Administrator



652 Posts

Posted - October 23 2003 :  6:09:38 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Yes,

I should start a list of "Requests" to turn VBA with dialog apps into a "scriptable" VBA.

If you see some "normal" VBA code with a dialog box as input and need it converted, I can do it (or give you a hand doing it... it's not that bad... (Maybe I'll write an FAQ or something) Once you see the VBA Commands, it's pretty easy to put a prompt on the command line and get some user input, do all the stuff in the background without the use of dialogs, and modify the drawing.

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

Admin
Administrator



652 Posts

Posted - October 23 2003 :  11:08:43 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Ok... here it is...

Extract this DVB file into your Hurricane/LISP/ folder.
Download Attachment: MTEXT.zip
8.78 KB

This Hurricane script should load and run it, then unload it...

;Start
-VBALOAD "$HUR_PATH$Lisp/Mtext.dvb"
-VBARUN MTEXT.SearchAndReplace
FindText
ReplaceWith

VBAUNLOAD "$HUR_PATH$Lisp/Mtext.dvb"
;End

If you have any trouble, please let me know asap... this is the first rev on this... (try it on some test files first!)

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

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - October 24 2003 :  09:05:09 AM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Wow... I can search and replace both dtext and mtext all in one shot now

If I need to search and replace dtext in a block I can still use the REPTEXT.lsp through Hurricanes tools menu.

Thanks

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Admin
Administrator



652 Posts

Posted - October 24 2003 :  09:11:06 AM  Show Profile  Visit Admin's Homepage  Reply with Quote
Yes,

This will be incorporated sooner or later in a revision. (I think I'll just add a Wizard for it, so you can fill in the "SearchFor" and "ReplaceWith" and it will create the script.)

For now to get all types of text, you'll have to use both routines (one being a lisp and the other VBA) (Use the "append" feature )

Hope this helps!
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

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - October 24 2003 :  09:17:11 AM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Ohh..You're right! Appending the LISP with the VBA should work perfectly! If the LISP doesn't catch it the VBA will...cant go wrong.

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Jdetaylor
New Member



USA
6 Posts

Posted - December 03 2003 :  10:01:23 AM  Show Profile  Visit Jdetaylor's Homepage  Reply with Quote
this may not be the right approach; but, I have an Excel spreadsheet that crunches numbers and places the answer text in specific workbook pages and cells....I have a template drawing with several blocks pre-saved; but I will only be inserting 3 or 4 in a sheet at a time...I now want to take specific Excel text cells and place it in the corresponding blocks I load in the drawing....it shouldn't matter if the data in the un-used cells is blank; because, those blocks won't be loaded...any ideas or advice.....thanks in advance

John Taylor
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - December 03 2003 :  11:10:38 AM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Basically...you want to "look up" data from a particular workbook and cell all while you are in AutoCAD

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Jdetaylor
New Member



USA
6 Posts

Posted - December 03 2003 :  11:45:12 AM  Show Profile  Visit Jdetaylor's Homepage  Reply with Quote
exactly; but, not all the data is necessarily used based on what blocks I insert into the drawing......and, so, how would this be accomplished

thanks
JTaylor
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - December 03 2003 :  12:03:52 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Of course you want this the be "scriptable"...correct?

Do you have attributes in the blocks? If so, are you wanting to change only the attributed items within the blocks?

...Or are you looking to change just text items? (or both?)

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Jdetaylor
New Member



USA
6 Posts

Posted - December 03 2003 :  1:29:35 PM  Show Profile  Visit Jdetaylor's Homepage  Reply with Quote
I was kinda hoping that I didn't have to use attributes and, yes, scriptable......I might want to search and replace text s1a23 with the text in workbook page s1 and in cell a23....that way, I can remember and see which text goes where....also, the block may end up getting mirrored, which is why I want to stay away from attributes

JTaylor
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - December 03 2003 :  2:07:46 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
So...correct me if I am wrong... the "block name" will never come into play. You will just simply search for text on the whole drawing.

Is "s1a23" a sub material piece mark...(or going to be)?

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Jdetaylor
New Member



USA
6 Posts

Posted - December 03 2003 :  7:31:35 PM  Show Profile  Visit Jdetaylor's Homepage  Reply with Quote
okay, heres what it is....I will have say 20 different steel stair stringers that will have a specific block neme that will correspond to the page name in the Excel workbook (stringer S1, which is block S1 will have its specific data stored in spreadsheet S1)....the variable dimension text will be the variable answers in spreadsheet S1
.....very simple I think....its basically a picture "form" that has dimensional variables that are to be calculated in Excel and transferred into the appropiate named block....hope that makes more sense

JTaylor
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - December 04 2003 :  8:40:09 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
I see Exactly! There would be a lot of other uses too!

A VBA run within Autocad...would need to simply "LOOKUP" data from your spreadsheet.

I simple lookup I'm sure is probably not that hard. Here is a thread that may be of interest.

http://www.eng-tips.com/gviewthread.cfm/lev2/22/lev3/70/pid/555/qid/72624

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Jdetaylor
New Member



USA
6 Posts

Posted - December 05 2003 :  09:46:11 AM  Show Profile  Visit Jdetaylor's Homepage  Reply with Quote
you nailed it exactly.....very interesting link.....now, couldn't Hurricane be set up to "script" a lookup with various parameters....the only problem I see is the length of the list of look-ups

thanks
JTaylor
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - December 05 2003 :  10:35:31 AM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
If it's done via VBA or LISP...without dialog boxes..it should pretty easy to script!

I would certainly like to find out how to do this! I can think of several different applications for this!

I'll keep digging for something...maybe someone out there has a few clues.

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
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.06 seconds. Snitz Forums 2000