Tip 2259: Process All Open Drawings This tip consists of a very basic VBA routine presented as a BAS file, RUNALLOPEN.BAS. It is a single public macro that will loop through all open drawings. In this case, the macro zooms the display of each drawing to the current extents. But you could do much more by adding acDWG.SendCommand lines that contain any AutoCAD commands you want. For this macro to work best, I suggest using generic AutoCAD commands -- nothing too complex -- such as a LISP routine, until you get a handle on the synchronizing of VBA, AutoCAD, and Visual LISP. This function works by iterating through the open documents in a current session of AutoCAD. VBA makes this task simple. |