Re: autonumber blocks It expects the num attribute to be the first attribute of a block called 'theblock'. Upon loading the following code from a file, the user will be prompted for a prefix, an initial value, and a suffix. Lee Mac Programming: Custom Programs for AutoCAD. The block references or multileaders are numbered in the order in which they are encountered in the drawing database. The program also allows the user to specify a numbering prefix & suffix, the starting number for the. Demonstration of Automatic Renumbering.
Blocks are one of the most important object types in AutoCAD and they are also very frequently used in almost all types of drawings. If you are not using blocks in your drawings then you should better start soon because you are missing some of the awesome benefits of AutoCAD blocks.
What are Blocks
In the context of AutoCAD, blocks are the collection of geometries that act as a single object and they can be used in a drawing repetitively. The blocks which are used in the drawing are called block references and if you modify the block all its references change automatically.
The blocks can be a plain simple collection of static geometries or you can also make blocks with dynamic properties and these types of blocks are called dynamic blocks.
Why you should use Blocks
As I mentioned earlier one of the primary reasons for using a block is its ability to modify all its references by modifying a single block.
As an example, if you are using blocks for creating windows in a floor plan and after adding the windows you decide to modify the type of window. In this case, you can simply modify the window block and all its references used in the drawing will change automatically.
Blocks also help you in keeping the file size under control. A drawing made with blocks for repetitive objects will be far smaller than the drawing which uses copied instances of repetitive objects.
Blocks also help in keeping consistency in your project drawings, by using the same set of blocks you can avoid a lot of confusion among different members working on a project. This is the reason many organizations prefer their own set of standard blocks which can be used and reused as per their own requirements.
You can also keep track of block data using attributes. The attributes are information such as manufacturer name, part number etc which is associated with a block and can be extracted to an excel file or a drawing table. To know more about blocks watch this video.
Block vs Groups
Groups have a little similarity with blocks and they can also be used in places where you want to make an object from multiple geometries. Groups don’t have the properties just like blocks, but if you want to categorize multiple objects as a single unit then groups are your best option.
To know more about groups watch this video.
Dynamic blocks
When you add dynamic properties to a simple block so that its geometry and property can be changed for its individual reference then you get a dynamic block. In case of dynamic blocks, you can stretch it to specified lengths, you can make arrayed copies, you can flip their direction or orientation etc.
As an example, you can make a dynamic block of a door of different sizes and when used in the drawing you can use the same dynamic block for all sizes of the door.
In this video, I have explained methods of making a door dynamic block in AutoCAD. You can also enroll in our dynamic blocks course if you want to learn more about this topic.
Using Design centre for blocks
AutoCAD has a small library of some standard blocks which you can use in your drawings, this library of blocks can be accessed from the design center palette. To open design center you can use keyboard shortcut CTRL + 2 or you can use its command ADCENTER.
The design center is simply a palette just like properties or layer properties manager palette. On this design center palette click on the home icon then select the en-us folder then DesignCenter folder and then select the drawing type from which you want to extract the blocks.
For example, you can use the kitchens.dwg file for kitchen blocks and House Designer.dwg for common household blocks. After selecting the drawing select Blocks from the object type and now you have a collection of blocks which you can insert in your drawing by simple drag and drop.
You can also use design center to extract blocks from an existing drawing. Simply click on the open icon on the top left of design center then locate your drawing and open it in the design center palette.
Now navigate to the drawing and select blocks and you will have your complete list of blocks from the drawing in the palette. You can drag and drop these blocks to bring them in your current drawing.
Using Tool Palettes for Blocks
AutoCAD also has many simple as well as dynamic blocks on the tool palette. You can access tool palette by using its keyboard shortcut CTRL + 3 or its command TOOLPALETTES.
Tool palette has many common blocks (especially dynamic blocks) that you can use directly in your drawing simply by dragging and dropping them in your drawing. You can also create your own tool palette and place your favorite CAD blocks on it, or you can create an entire catalog of your standard cad blocks using tool palettes.
More about tool palettes is explained in the related article shown below.
Related:Create, Customize, Export and Import AutoCAD tool palettes
Need more CAD blocks?
Apart from creating your own set of blocks and using the design centre or tool palette you can also use some other resources to get CAD blocks for your projects. Some of my favorite free CAD block websites are following.
How do you use CAD blocks in your drawing? let us know in the comments below.
Get access to all Courses, eBooks and Downloads on SourceCAD
In AutoCAD, there is no direct command for finding the number of entities with a particular property but you can harness features of quick select tool to do this task. I will illustrate this tool with the help of two simple examples.
Finding the number of circles of particular radius:
Let’s assume that we want to know the number of circles with radius 2 units from our drawing. To do that click on the Quick select tool on the Utilities panel of Home tab. Alternatively, you can also use its command equivalent QSELECT.
From Apply to drop-down menu of the Quick Select window select Entire drawing option. In next menu, a list of all items present in the drawing will appear select circle from object type drop-down menu.
Now all the properties associated with circle will be listed in the properties panel, select the radius from the Properties panel.
Select =Equals operator from next menu and enter the radius of the circle in the Value field. In this case, I am entering 2 as the radius then click OK. If you want to select all circles in the drawing with the radius greater than 2 units then select > greater then operator, similarly other operators can be chosen depending upon your requirement.
Once you have made all settings in Quick select window click OK. You will see the number of circles with radius 2 units above command line as shown below.
If you want to find the total number of circles in the drawing then select radius in property menu. From the Operator menu, select the Greater than operator and enter 0 in the value field. It’s obvious that radius of all circles present in the drawing will certainly have a value greater than zero!
In a similar way, you can create as many criteria as you want for finding or selecting objects of a particular property from your drawing. Quick select will not include objects which are present in a block even if they meet the criteria described by the quick select command.
To find the number of Blocks in a drawing:
AutoCAD offers a direct command BCOUNT for finding the number of each block used in the drawing. This command can only count active blocks in your drawing which means if you have a block which is not used in the drawing area then the result will not contain its count.
To see the number of blocks type BCOUNT on the command line and press enter then select an area in the drawing from where you want to count blocks. To count the number of blocks in entire drawing don’t select an area directly press enter and the complete drawing will be selected.
Once you have made selection press enter to get results, the final count of blocks will appear above the command line as shown in the image above.
You can expand command line to see the result or type F2 to bring a popup window with command history containing results.
Do you have questions related to this tip? Let me know in comments below.