Global Attribute Extractor & Editor

Function Syntax MacAtt / MacAttExt / MacAttEdit
Current Version 3.1
Download MacAttV3-1.lsp
View HTML Version MacAttV3-1.html

Program Description

This program enables the user to both extract multiple block attributes from a directory (and subdirectories) of drawings to Excel, and furthermore edit the values of several attributes in such drawings. The program uses ObjectDBX functionality, meaning hundreds of drawings may be processed in under a minute as no drawing need be opened for the program to extract/modify the relevent information.

Global Attribute Extractor

This program will retrieve specific attribute values from blocks in a user compiled list, from either the current working drawing, or all drawings in a directory, and, if specified, all subdirectories of the selected directory.

The program may be started by typing MacAttExt at the AutoCAD command line, (or alternatively by typing MacAtt and selecting the Extractor option).

The user is presented with the following dialog interface:

Global Attribute Extractor Main Interface

MacAttExt Main Dialog.png

Here, the user may specify the name of, or select, a block containing attributes to be extracted, and subsequently enter the tag strings of attributes whose values are desired to be extracted.

If the user chooses All Tags, every attribute found within the block specified will be extracted; else the user may select the Choose Tags button, and manually enter specific attribute tags to be extracted.

Attributes to Extract Dialog

Choose Tags Dialog.png

Using this dialog, the order in which the attributes are written to Excel may also be controlled. Groups of attribute tags may be moved up & down or sorted alphabetically using the controls located near the bottom of the dialog panel

When satisfied with the data entered, the user may click Add Block to add the specified block and attribute preferences to the list.

Entries listed in the centre panel of the dialog may be edited by double-clicking on the relevant entry. This will open the Attributes to Extract dialog, allowing the user to refine the attribute information entered.

A directory of drawings may then be selected to process - the user also has the option to process all subdirectories of the selected directory; or merely the current working drawing.

Extraction Formatting Options

The Global Attribute Extractor offers three different formatting options controlling the layout of the attribute information in Excel.

Options Dialog

Options Dialog.png

Group By Filename

This is the default mode and will list the blocks under the filename of each drawing processed.

Drawing Filename
Block Name
Tag1 Tag2
Value1 Value2

Group By Block

This mode will disregard the drawing from which the attribute has been extracted and rather group all attribute values under the block name from which they were extracted.

Block Name
Tag1 Tag2
Value1 Value2

Drawing List Mode

This mode is aimed at extracting attributes from titleblocks, in which the user may have many similar blocks with almost identical attribute tags. This mode will not write the names of the blocks from which the attributes are extracted, but will append the drawing filename from which the attributes are found to the end of the values.

Tag1 Tag2 CAD Filename
Value1 Value2 Filename

The user may also opt to extract the coordinates of the block from which the attributes are extracted by checking the relevant box in the Options dialog.

When all data in entered and the formatting mode is set, the user may proceed to perform the attribute extraction wherein all drawings found in the selected directory (and subdirectories), or just the current drawing are processed using ObjectDBX. This functionality means that hundreds of drawings may be processed in under a minute as no drawing need be opened to extract the necessary information. The program will subsequently write the attribute information to a new worksheet in Excel.

Global Attribute Editor

The program may be started by typing MacAttEdit at the AutoCAD command line (or, alternatively by typing MacAtt and selecting the Editor Option).

This program utilises a similar interface to the Global Attribute Extractor; the user may enter a block name and proceed to input multiple attribute tags contained within such block whose values are to be edited.

Global Attribute Editor Main Interface

MacAttEdit Main Dialog.png

A directory may subsequently be selected and all drawings found in the chosen directory, and, if desired, subdirectories of the selected directory, will be processed.

Instructions for Running

Please refer to How to Run an AutoLISP Program.


increase · reset · decrease

Designed & Created by Lee Mac © 2010