Adjust Text for All Drawings in a Directory Our last tip of the month is another monster cool routine from Andrzej Gumula in Poland. Adjust Text for All Drawings in a Directory (Tip #2028) demonstrates how the AutoCAD object system as exposed in Active X can be exploited by Visual LISP. One problem that has always plagued LISP programmers in AutoCAD is how to exploit the system's tools in Windows, and Andrzej demonstrates how easy it is using objects in AutoCAD. Plus, this handy utility can be used for title blocks, drawing notes and so forth to update complete projects with a single command. This utility consists of a LISP source file and a dialog box DCL file. Place the dialog box file in a directory where AutoCAD can find it. Then load the LISP file and type Reid at the AutoCAD Command line. A dialog box will appear with the options available as shown (figure 2).
Enter the text to be changed, select the directory to search and select the various search-and-replace parameters you want, then press OK to let it fly. This utility goes through the folder selected and replaces any text found, all the while reporting the progress at the Command line in AutoCAD. This routine is brilliant, and Harry tips his hat to the programming genius Andrzej!
|