×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

AutoCAD + VBA + Find

AutoCAD + VBA + Find

AutoCAD + VBA + Find

(OP)
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.

RE: AutoCAD + VBA + Find

Hi whycliffrussell,

Which part are you having trouble with, parsing a list of drawings, or performing the actual search?

RE: AutoCAD + VBA + Find

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources