Count Blocks Quickly

Do you often find yourself needing to count or locate all instances of specific blocks in your drawing? With the Count feature, introduced in AutoCAD 2022, you can quickly and easily count instances of blocks and many other object types in your drawing.

For those using AutoCAD 2018 and later, Quick Select is a great alternative to the Count feature.

In this Have You Tried, we'll guide you through the process of using both the Count and Quick Select features, showing you how to count blocks, view detailed count data, use wildcard specifications, and count blocks on a specific layer. Moreover, we'll also show you how to create a table to organize and visualize your count results.

Note: The video doesn't contain audio or closed captions.
Note: Steps, images, and videos may differ slightly from your version of the product.

Prepare for the Walkthrough

To follow along with these exercises, download the sample file.

Download: Sample file used for the exercises in the following sections.

Alternatively, do the following steps to create several blocks and place them on several layers.

  1. Start a new drawing.
  2. Create three blocks and name them A410, B424, and B664.
  3. Create two new layers named 001 abc and 005 def.
  4. Insert 5 more instances of A410 on layer 001 abc.
  5. Insert 4 more instances of B424 on layer 001 abc.
  6. Insert 3 more instances of B664 on layer 005 def.

    The results might look something like this:

Count Feature (AutoCAD 2022 and Later)

The Count feature provides a quick and efficient method to count instances of blocks and many other object types within a specified area or an entire drawing. It enhances the user experience by presenting visual results, including highlighted counted instances and detailed information displayed on the Count palette and toolbar. The Count feature also includes an error-reporting function that identifies potential discrepancies, ensuring the accuracy of your drawing.

The subsequent exercises will guide you through the various tasks of using the Count feature.
Note: If you're using AutoCAD 2021 or an earlier version, skip to the Quick Select section below.

Count Block Instances in a Drawing

  1. Click View tabPalettes panelCount. Find
    By default, the Count palette displays all the blocks in drawing along with their corresponding count.
  2. On the Count palette, select a block (for example, A410).

    Selecting a block starts an active count. When you're in an active count, a blue border appears around the drawing area and the Count toolbar is displayed at the top.

    In the following image, the A410 block instances are highlighted.

View Count Details

The Count feature presents visual count results, allowing you to easily view the information of a counted block. The count details may include the counted object’s general properties, any user-defined block attributes and parameters, or a count error report.

Note: For the purposes of this exercise, a drawing error was intentionally added to the downloadable sample file. If you’ve created the drawing from scratch, copy an inserted block on top of itself to create an overlapping block to follow through this exercise.
  1. On the Count palette, enter b in the Search box.

    The Count palette displays the block names that start with the characters you type. This is useful when you need to quickly find blocks and their count based on a name.

    Block names beginning with B are displayed.
  2. Select B424 (or the name of the overlapping block in your drawing).

    The B424 blocks are highlighted. In this example, you can see an icon () displayed on the Count palette and Count toolbar. The block instance flagged with an error is highlighted in a different color (red).

  3. Click on either Count palette or toolbar.

    Alternatively, on the Count palette, right-click B424 and choose Review Count Details.

  4. Click the count error, or in this case, Overlapping object.

    AutoCAD zooms in to the block instance with the detected error.

  5. Examine and remove the overlapping block.
    Note: To easily remove overlapping objects from a drawing, you can use the OVERKILL command. For more information, see Have You Tried: Purge and Overkill.
  6. On the Count palette, click Back to List.

Create a Count Table

Sometimes you'll need to present a comprehensive overview of your drawing, for example, when conducting a design audit or creating an inventory of design components. With Count, you can easily list the blocks and their count in a table.

  1. On the Count palette, click Create Table.
  2. Select the blocks you want to add to the table. In this example, select all blocks and click Insert.
  3. Specify an insertion point to place the count table into the current drawing.
    Note: The new count table uses the current table style.
  4. If your blocks contain attributes, you can also extract and aggregate those values in a table with the Data Extraction feature. For more information, see Have You Tried: Extract Attribute Values from Blocks.

Tip: To remove the gray background in the count field, set FIELDDISPLAY system variable to 0.
You can also directly insert a field of the current count of a selected block.
  1. Select a block (for example, B664) in the drawing area.
  2. Right-click and select Count Selection, if the Count toolbar is not already open.
  3. On the Count toolbar, click Insert Count Field.
  4. Specify a start point and place the count field into the current drawing.

    The field displays the current count of the selected block.

  5. Note: Use REGEN to update the count field.

Quick Select (AutoCAD 2000 and Later)

Note: The video doesn't contain audio or closed captions.

Note: Steps, images, and videos may differ slightly from your version of the product.

If you're using AutoCAD 2021 or earlier, the Quick Select feature is another powerful tool designed to streamline the object selection in a drawing. It allows you to filter and select objects based on shared properties such as object type, color, or layer.

In the following exercises, we'll guide you through a series of tasks using the Quick Select feature to count blocks in your drawing.

Count Blocks by Name

  1. Click Home tabUtilities panelQuick Select. Find

    Alternatively, at the Command prompt, enter qselect.

  2. In the Quick Select dialog box, choose Block Reference and choose A410 from the list, along with the other values as shown below.
  3. Click OK.

    The specified blocks are now selected and included in a new selection set, and an accurate count of the specified blocks is reported in the Command window.

  4. Press Esc to clear the selection set.
Note: Blocks that are nested within other blocks (blocks within blocks) or associative array objects aren't selected or counted with Quick Select.

Count Blocks with Wildcard Specifications

Sometimes you'll need to count blocks using a general name pattern. The most common wildcards used are "?" for a single character and * for any number of characters. For example, you can search for all blocks beginning with the letter B using B*, and all the blocks that have 4 as their second character using ?4*.

  1. Start the QSELECT command again, this time specifying a Wildcard Match with the Value: B* as shown below and click OK.

    All blocks beginning with B are selected as shown below.

    Once again, an accurate count is displayed.

  2. Press Esc to clear the selection set, and repeat the operation, except use ?4* in the Value field and click OK.

    All instances of blocks A410 and B464 are selected, and an accurate count is displayed in the Command window.

Count Blocks on a Layer

To count all blocks on a specified layer, follow these steps:

  1. Start the QSELECT command.
  2. Specify Layer and choose 001 abc for the Layer value and click OK.

    All blocks on layer 001 abc are added to a new selection set, and the block count is displayed.

  3. Don't clear the selection set yet. You'll need the blocks selected for the next steps.

Narrow Down a Selection

At this point, you're probably asking yourself how you can narrow the selection using multiple criteria. For example, how can you count all instances of block A410 on layer 001 abc?

There's an easy way of doing this!

  1. Start the QSELECT command.

    Currently, all blocks on layer 001 abc are selected. Notice that the Apply to field has automatically switched to Current selection as shown below.

    This means that only the current selection set will be used rather than the entire drawing.

  2. Next, choose Name and then block A410 and click OK.

    All the A410 blocks (only) on layer 001 abc (only) are selected. With any selection set, you can repeat the QSELECT command to continue narrowing your selection.

Notice that you can start with a manually specified selection set of a portion of the drawing area, further filtering it with a succession of Quick Selection operations.

Note: To save a highly specified selection set, you can create a group from the selected objects with the GROUP command. For more information, see Have You Tried: Groups.

In addition to providing a fast way of counting specified blocks, the Quick Select feature can also be used for many other tasks involving selecting objects. For example, you can use Quick Select to do the following:

  • Select a subset of objects on a layer, and then assign them to a different layer.
  • Select all dimension objects regardless of layer, and then change their color.
  • Identify geometric objects with Z coordinates not equal to 0, and then set their Z coordinates to 0.

While there are other methods available in AutoCAD to count blocks, the Quick Select feature has the flexibility to be applied broadly to a variety of other tasks.

Tip: For simple "matching" selections, try using the SELECTSIMILAR command on the current drawing. Use the SEttings option to specify various combinations of properties, and then the SELECT command or Properties palette to get the count. In addition, the BCOUNT Express tool (AutoCAD only) reports an itemized block count within a selection set or the current drawing.

Summary

The Count and Quick Select features in AutoCAD simplify the process of counting blocks in a drawing. They help you identify, select, and manage blocks more efficiently.

Related Commands and System Variables

Here are some frequently used commands and system variables related to counting blocks in a drawing.
Command Description
COUNT Counts and highlights the instances of the selected object in the drawing.
COUNTAREA Defines the area to count the instances of an object or block.
COUNTFIELD Creates a field that's set to the value of the current count.
COUNTLIST Opens the Count palette to display and manage the counted blocks.
COUNTTABLE Inserts a table containing the block names and the corresponding count of each block in the drawing.
QSELECT Creates a selection set based on filtering criteria.
SELECTCOUNT Finds all objects within the current count that match the properties of the selected objects, and then adds them to the selection set.
SELECTSIMILAR Finds all objects within the current drawing that match the properties of selected objects, and then adds them to the selection set.
System variable Description Default value Saved in
COUNTCHECK Controls the types of errors to check in the count. 2 Registry
COUNTCOLOR Sets the highlighting color on objects in a count. 3 Registry
COUNTERRORCOLOR Sets the highlighting color on objects that can cause potential errors in a count. 1 Registry