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.
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.
- Start a new drawing.
- Create three blocks and name them A410, B424, and B664.
- Create two new layers named 001 abc and 005 def.
- Insert 5 more instances of A410 on layer 001 abc.
- Insert 4 more instances of B424 on layer 001 abc.
- 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.
Count Block Instances in a Drawing
- Click View tabPalettes panelCount.
Find
By default, the Count palette displays all the blocks in drawing along with their corresponding count.
- 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.
- 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. - 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).
- Click
on either Count palette or toolbar.
Alternatively, on the Count palette, right-click B424 and choose Review Count Details.
- Click the count error, or in this case, Overlapping object.
AutoCAD zooms in to the block instance with the detected error.
- 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.
- 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.
- On the Count palette, click Create Table.
- Select the blocks you want to add to the table. In this example, select all blocks and click Insert.
- Specify an insertion point to place the count table into the current drawing.
Note: The new count table uses the current table style.
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.
- Select a block (for example, B664) in the drawing area.
- Right-click and select Count Selection, if the Count toolbar is not already open.
- On the Count toolbar, click Insert Count Field.
- Specify a start point and place the count field into the current drawing.
The field displays the current count of the selected block.
Quick Select (AutoCAD 2000 and Later)
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
- Click Home tabUtilities panelQuick Select.
Find
Alternatively, at the Command prompt, enter qselect.
- In the Quick Select dialog box, choose Block Reference and choose A410 from the list, along with the other values as shown below.
- 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.
- Press Esc to clear the selection set.
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*.
- 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.
- 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:
- Start the QSELECT command.
- 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.
- 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!
- 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.
- 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.
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.
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
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 |