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

 All Forums
 Hurricane for AutoCAD
 Tips and Tricks
 Text & MText & Attribute Text Search and log
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Admin
Administrator



651 Posts

Posted - March 04 2003 :  10:19:11 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hello!

Here is a new VBA I wrote to be able to Search and Log text (of the 3 main types of text, TEXT, MTEXT, and ATTRIBUTES in BLOCKS), and log the resulting files into a .LST file. (The LST file get automatically placed in the Hurricane/DATA directory)

What to do to try this...
-> UnZip the updated hurricane.exe (attached, <b>always backup your old one</b>), run it (this should write a registry key which the VBA will look for to find the DATA directory)

1) Start the VBA editor in AutoCAD by typing VBAIDE at the command prompt.

2) Drag and drop the BAS file into the VBA editor (will probably rename itself to module11.bas or similar)

3) Save your VBA file in a known location:
i.e. - C:PROGRAM FILESACAD2000VBAFINDANDLOG.DVB

4) You can now open a drawing in AutoCAD that has some text, and run the VBA routine. You can either run it by clicking within the routine <b>FindAndLog</b> and press <b>F5</b>, <b>OR</b> type <b>VBARUN and type FindAndLog</b>.

<i>5) As long as the file is not been "Embedded", then the VBA file will still be loaded even after you open a different drawing.</i>

The prompts that apprear when you:
-VBARUN FINDANDLOG
Enter Search String:
Enter OutPutFile Name Prefix:

The Search String is the text you will be looking for
The Output file Name Prefix is what you want to call your LST file.
(Based on these two items, you output file will be named appropriately, i.e. if you search for 110Volt, and your output file prefix is "SkyLine", then your LST file will be named "SkyLine - 110Volt". So you can use this routine to basically "catalogue" text in your drawings, or easily search for words or phrases that may exist in some drawings, but you don't know which ones.

<i>Anyhow, this is rather long winded, but it shows a few examples (good or bad?) of i/o in VBA, reading the registry etc. For those of you who are new to this, and want to learn something, here you go. I'm not claiming that this IS the only way to do this, but it seems to work well, so I am sharing it. Please feel free to modify, and/or correct me!</i>

And of course, if you have any questions, just ask!

I have attached a new version of Hurricane. 6.0.91, it is required to run a VBA that I have been working on. <i>(Actually, the only thing added to this new Hurricane is that when run, it writes its current operating path to the registry so that the VBA program knows where the root Hurricane directory is, so the LST file can be written in the DATA directory)</i>

<b><i>(You will need this version of Hurricane or NEWER)
</i></b><b>Download Attachment:</b> hurricane6091.zip<br />109.46 KB

Here is the VBA file (in BAS format)

<b>Download Attachment:</b> find_and_log v.05.zip<br />1.72 KB

Best Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
  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.33 seconds. Snitz Forums 2000