Finding .dwg files containing a text string

Posted on 2006-05-02
Medium Priority
Last Modified: 2012-06-21
I want to search a large directory structure for all ACAD .dwg files containing a particuar word in a note.

I've tried the Windows Search function assuming that drawing notes would be ASCII encoded, but apparently that was a bad assumption. (I'm running Win2K.)

Is there any way to do this?
Question by:GaryGarnier
LVL 13

Expert Comment

ID: 16592180
Could you not use windows explorer search and use something like this?


Author Comment

ID: 16593327

I've tried (unsuccessfully) Explorer search as you suggest (putting the word I want in the "A word or phrase in the file" field) but without the stars. When I get to work Wednesday I'll try it with stars, but I don't expect a different result.

I renamed one ACAD file, gave it a .txt extension and opened it with Notepad. As I said in my question, it appears that even drawing notes are not ASCII-coded in a .dwg file. I think this will require a fairly sophisticated solution involving a knowledge of how AutoCAD encodes user-entered text within a file.
LVL 13

Expert Comment

ID: 16598065
The 'stars' are wild cards. It should work as long as you supply a key word in the method I mentioned above.
It should read *word*.dwg

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.


Author Comment

ID: 16598230
I know about wild cards - but if you'll note in my original post, I'm searching for files that have a particular word within a note inside the file, NOT files having that word in the file name.

If the files of interest were Word .doc files, I could just Search for files named *.doc and put the target word in the "A word or phrase in the file" field. But apparently ACAD does not use ASCII encoding for user-entered text such as notes. That's why I think this requires a solution that exploits knowledge of how text is encoded in an ACAD file.
LVL 14

Accepted Solution

Tommy Kinard earned 2000 total points
ID: 16598719
Hi GaryGarnier

We could use VBA to open the drawings search for what you want to, put the file name and path in an array, write the array to a file after processing all of the dwgs in the directory. Or fix the problem (if it is a problem).

Or we could use a converter on the dwgs, change to dxf's and search the dxf's with windows search for text in documents options. Long way around IMHO.


LVL 13

Expert Comment

by:Corey Scheich
ID: 16807012
I have used DragonTooth's method in the past.  You will have to recurse both the ACADText Objects and block attributes for the values.  I was able to find and replace TitleBlock text on thousands of drawings in a resonable amount of time.

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article will describe how to add/edit a dimension style through AutoCAD VBA. AutoCAD VBA has its quirks and when it comes to dimensions and controlling how they look through VBA.  This is where AutoCAD can be vividly confusing. The…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question