The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 AutoCAD
 Lisp & Other Handy Files
 find and replace Mtext

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
Miksteele Posted - October 23 2003 : 5:00:42 PM
Has anyone run into a "find and replace" FOR MTEXT
19   L A T E S T    R E P L I E S    (Newest First)
Miksteele Posted - December 05 2003 : 10:35:31 AM
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.
Jdetaylor Posted - December 05 2003 : 09:46:11 AM
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
Miksteele Posted - December 04 2003 : 8:40:09 PM
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
Jdetaylor Posted - December 03 2003 : 7:31:35 PM
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
Miksteele Posted - December 03 2003 : 2:07:46 PM
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)?
Jdetaylor Posted - December 03 2003 : 1:29:35 PM
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
Miksteele Posted - December 03 2003 : 12:03:52 PM
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?)
Jdetaylor Posted - December 03 2003 : 11:45:12 AM
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
Miksteele Posted - December 03 2003 : 11:10:38 AM
Basically...you want to "look up" data from a particular workbook and cell all while you are in AutoCAD
Jdetaylor Posted - December 03 2003 : 10:01:23 AM
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
Miksteele Posted - October 24 2003 : 09:17:11 AM
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.
Admin Posted - October 24 2003 : 09:11:06 AM
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
Miksteele Posted - October 24 2003 : 09:05:09 AM
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
Admin Posted - October 23 2003 : 11:08:43 PM
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!)
Admin Posted - October 23 2003 : 6:09:38 PM
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
Miksteele Posted - October 23 2003 : 6:00:32 PM
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




Admin Posted - October 23 2003 : 5:50:14 PM
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
Miksteele Posted - October 23 2003 : 5:29:41 PM
Do you know is it's compatable with DTEXT also?
Admin Posted - October 23 2003 : 5:26:16 PM
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

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