Auto-Numbered Blocks for Simple AutoCAD

Sahil was looking to automate the numbering of lighting poles while only incrementing the middle number, our friend needs some help. Here’s how we can help.



First, I asked our friend to send me his drawing to understand his workflow. Upon inspection, I saw that the lighting pole number was the one in the middle, and that they were using an Mtext on a block with instructions.


To update this, I used the Ctrl+Shift+X shortcut to cut the text from the center point of their block and pasted it with Ctrl+V into the Block editor. Then, I introduced an attribute definition using the ATT shortcut and populated some information, setting the number to 1, text justification to Center and Middle Center, and text height to match their text size of 2 inches. I then removed the middle number to make space for the updated number.


After closing the Block editor and saving the changes, I fixed any rotation and mirroring issues and used the ATTsync command to refresh the attribute definition.

To automate this, I used a macro code that I had previously created and copied from our Patreon page to pasted it into the tool palette with Ctrl+3.

I changed the block name in the code to our friend’s block name, “4 M Pole”, and used quotes to avoid issues with the spaces in the name. After testing the new command and running into issues, I decided to create a new block from scratch with an attribute to avoid any issues with Imperial and Metric units.

I created a new block using the B shortcut and called it “4_M_Pole” with underscores. I then added an attribute definition and populated it with information, including the number set to 1, text justification to Center and Middle Center, and text height to match the original text size of 2 inches. After saving and syncing the attribute definition, I updated the macro code with the new block name.

Finally, i tested it again, which worked successfully.

With these steps, we were able to automate the numbering of our friend’s lighting poles while only incrementing the middle number, streamlining their workflow.

Hope this new command can save Sahil and you some time, and please #StopWastingTime in AutoCAD!

Watch the full AutoCAD series here https://youtube.com/c/lazyarquitecto
FREE 5 Automatic AutoCAD Commands here https://mailchi.mp/bc036ed55311/lazyarquitecto
Support my work using affiliate link to purchase anything at no cost to you https://amzn.to/34OZ1en

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top