Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoCAD + VBA + Find

Status
Not open for further replies.

whycliffrussell

Electrical
Jul 10, 2006
92
Ok. I have a list of text strings that I want to search for in multiple .dwg drawings in a directory (the text can either be in .txt or .xls format).

Is there a way to use VBA to sequentially search through each drawing and zoom to the text in in the list one at a time? (having the user hit 'ok' or something for the vba code to move to the next item in the list.

.xls or .txt text list list of autoCAD dwgs
item 1 drawing 1.dwg
item 2 drawing 2.dwg
item 3 drawing 3.dwg

the program would seach for item 1 in each drawing (unil it has found in in the drawing list, contained in a specified directory), zoom to it, and when the user hits 'ok' would move on to item 2, and start searching the .dwg list...etc.

 
Replies continue below

Recommended for you

Hi whycliffrussell,

Which part are you having trouble with, parsing a list of drawings, or performing the actual search?
 
That's easy, you need a control named FileListBox which has two properties are useful for you, they are FileListBox.ListIndex and FileListBox.FileName, when you get it you just do the following:

1)get the name from .txt or .xls
2)get the name of .dwg in the specified directory
3)are they the same True or False

Oh! by the way one more important thing is the FileListBox.ListCount.

Patrick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor