Cadtales
USING ATTRIBUTES AS AN ITEM COUNTER

by Jim Rogers, CADreps
Attributes, “place holders” for data, are a staple of
AutoCAD, used regularly to store data about a particular
item, collect and summarize that data and to present it in a
table or separate file or document. This article explains
the operation and use of the Enhanced Attribute Extraction
program (EATTEXT) and how to make a simple item counter
using Attributes. We’ll do this by creating a couple of
simple blocks, assigning Attributes and then using the
EATTEXT program to extract and format the data for
presentation in a pre-configured table.
Let’s start by creating two simple objects, a BOX and a
CIRCLE:
-
Draw a 1x1 rectangle in either paper or model space.
-
Use the Block command to turn it into a block. Name the
block “BOX,” use any base point you prefer, select the
object and check the “Open in block editor” option.
-
In the Block editor use the ATTDEF program to assign an
Attribute. In the Attribute definition dialog box input
the settings shown in Figure 1. Place the Box_tag
attribute anywhere on, in or near the box object. (See
the notes below for explanations regarding these
settings).
-
Close the Block editor and save your changes.
-
Repeat these steps for the CIRCLE object using an
appropriate tag name and any other blocks you want to
include in this example. Pay attention to spelling and
capitalization as the block name will be a line-item in
our extraction table.

Figure 1
In this example we want the data place holder to be “fixed”
and “empty” so we’ll check the Invisible and Preset boxes
and leave the Prompt: and Default: windows empty. And, we’ll
be using the block names “BOX” & “CIRCLE” as the line items
in the table. The text settings are unimportant since the
output will be controlled by the table format. One note
about text size is worth mentioning, however. We’ll be
loading this block onto a Tool Palette and the image created
will reflect the relative combined size of the Box and the
text. The text size should be reasonable compared to the
size of the object. If the text is too small, not much will
happen as the Box object will control the Tool Palette image
size. If the Attribute text is much larger than the Box,
then the Tool Palette image of the Box will be very small
and difficult to read.
FORMATTING A TABLE STYLE
Use the Format>Tablestyle program to make a new table style
called Item Count. Use the settings shown in Figures 2 & 3
below.

Figure 2

Figure 3
Remember that Rows and Columns are not set in the style
and are configured when inserting the table into the
drawing. Note the “Margins” settings in Figure 2 as they
control the white space between the text and the lines that
form the table. The text size of 3/32” is appropriate for a
table inserted in Paper Space, on A thru D size sheets.
Scale up appropriately for tables inserted into Model Space
and/or larger sheets. Try inserting a sample table using the
settings shown in Figure 4 below.

Figure 4
If this is your first time to format a Tablestyle you
might want to try the “Learn about Tables” tutorial link in
the lower left corner of the Insert Table dialog box.
CREATING AND LOADING A TOOL PALETTE
First, save your drawing containing the sample blocks. The
Tool Palette program only deals with blocks in the original
resource file – and not with blocks in the open drawing (in
memory).
Open the Tool Palette with the icon on the standard tool bar
or use CTL+3. Right-click on the title bar and select “New
Palette” and give the Palette a name.
Select one of the blocks made earlier to highlight, place
the cursor on any part of the object – except the blue Grips
– and click & drag the block onto the new Palette. Hold the
pick button until you see a black position bar. If there are
other items on the Palette you can move the mouse up or down
to position the new entry in a preferred place among the
other Palette objects. In our case, the block can only be
inserted at the top of a new Palette. Repeat for the other
block(s).
THE ENHANCED ATTRIBUTE EXTRACTION WIZARD
Wizards are quick, efficient “how to” programs that step the
operator through a series of screens with information and
choices in order to configure a desired outcome. The EATTEXT
wizard is just such a tool, and while it is short on
information and has too many screens (in my opinion), it is
effective in getting us to the goal of extracting designated
data from one or more drawings (sheets), or sheet sets.
Use the newly installed blocks on the Tool Palette to insert
a quantity of each block into the current drawing space.
Open the EATTEXT program and note the settings in the dialog
box images below:

Figure 5
In Figure 5 (Page 1 of 8), use the default “Create a new
data extraction …” since this is a new creation. (If this
were a repeat you would check the “Use previous …” box and
select the appropriate file. Click NEXT.

Figure 6
In the Select file: dialog box give the extraction file a
path & a name. Click Save.

Figure 7
In Figure 7 (Page 2 of 8) we’ll Define the Data Source(s).
Check the “Include current drawing” box if you want to
create an Item Counter that spans several sheets. Check
“Select objects in the current drawing” if the Item Counter
will be limited to the current file. The Add Folder and Add
Drawings buttons on the right allow you to include resources
anywhere on your system or network. Click NEXT.

Figure 8
In Figure 8 (Page 3 of 8) the dialog box opens with the
“Display all object types” turned on. To filter this list:
Un-check the “Display all” box. Check both the “Display
blocks ...” & “Display objects ...” boxes. This will limit
the displayed items to those of current interest in a
filtered list. See Figure 9 below.

Figure 9

Figure 10
Figure 10 (Page 4 of 8) is the Select Properties box and it
also opens with everything turned on. To filter this list,
in the Category filter: Leave the Attribute box checked.
Un-check the remaining choices. See Figure 11 below. Click
NEXT.

Figure 11

Figure 12
Figure 12 (Page 5 of 8) is where we refine our data. Note
the double listing for our BOX and CIRCLE blocks. This is
probably a bug in the extraction tool. The program appears
to see the creation and subsequent insertions of the block
as different items. A work-around for this error is
explained below.
In the Refine Data dialog box note the similarity to an
Excel spreadsheet. To sort a column click the column header
and click again to change from ascending to descending. To
hide a column: right-click the column header and select
“Hide Column.” To re-arrange the columns: click and drag a
column header left or right. Move the Name column to the
left position.
Each time you click a column header to sort the contents you
are setting a “Sort Columns” feature in the background. Open
the “Sort Columns Options” to see and manage these settings.
See Figure 13.
Click the Full Preview button to see how your table will
appear, See Figure 14 below. Select NEXT.

Figure 13

Figure 14

Figure 15
Figure 15 (Page 6 of 8) tells the program where to place the
Data Table. For this example use the default choice shown in
Figure 15 above.

Figure 16
Figure 16 (Page 7 of 8) is where we select our
pre-configured Table Style “Item Count.” Also, in this
dialog box, you can input the Title (we used ITEM COUNTER).
Check the “Use property names …” option so that the block
name(s) will appear as the objects being counted. Click
NEXT.

Figure 17
Figure 17 (Page 8 of 8) is the final page and is pretty much
self-explanatory. After clicking FINISH the newly created
table will be attached, at long last, to your cursor. Find a
suitable spot in your drawing and click to place. The table
will still show the error count. See Figure 18 below.

Figure 18
As you continue to work the drawing, adding and removing
attributed blocks, you can UPDATE the table by highlighting,
right-click and select “Update Table Data Links.” See Figure
19 below.

Figure 19
Erase and/or add a few blocks and Update the table links
again. If you want to include new blocks with different
Attributes in this table you will have to go thru the entire
EATTEXT process again, choosing “Edit an existing data
extraction” option in Figure 5 above, and checking the boxes
for the new Attributes in the Define Data dialog boxes in
Figure 11 above.
WORK-AROUND
In the example above our Item Counter had separate listings
for the same block. This problem seems to occur 1) if the
originally created block is left in the drawing – and
additional blocks are inserted, and 2) when existing blocks
in a drawing are re-defined to include a new Attribute. To
reconcile this issue, you can erase all the existing
instances of the offending block(s) and re-insert again. In
our example you can try this by erasing all the existing
blocks in the drawing and updating the table data links.
Now, insert several instances of the blocks and, again,
update the table data links. (This could also have been
corrected by erasing only the original blocks created by the
Block Definition program and retaining the secondary
insertions). The table is now correct. See Figure 20 below.

Figure 20
Do you see a productivity and quality benefit to applying
Attributes and Extraction Tables to your design and drafting
environment? Call your Hagerman sales representative about
software upgrades, training and customization.