[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Tip 2259: Process All Open Drawings
Tip# 2259 By Bill Kramer On 01-Dec-2007
Rated By 1 users Downloaded : 396
Categories : File Data, Misc. User Tools
Software type : AutoCAD
Rename File To : Tip 2259: RUNALLOPEN.BAS
RUNALLOPEN.BAS: Single public macro for use in VBA programming; loops through all open drawings to perform a given function on each.

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.



Average Rating:

User comments

Log In