AutoCAD – Drawings

Dynamic blocks in AutoCAD: one block for every door size

Dynamic blocks in AutoCAD let one reference change size instead of being redrawn. Measured on AutoCAD 2027, with the sample library and the RESETBLOCK trap.

  • TS. Đỗ Quốc Hoàng
  • 10 min read
The same block reference on AutoCAD 2027, copied three times and set to three widths Photo: Screenshot taken on AutoCAD 2027 at the Institute

Every architectural drawing is full of doors: 600 wide, 800 wide, 900 wide. The usual answer is one block per size, and a block table with a dozen near-identical names in it. Dynamic blocks in AutoCAD collapse the lot into a single reference: pick it, drag one arrow, and the width changes while the height stays put.

The three doors in the opening figure are one reference copied three times. Everything below was measured on AutoCAD 2027 at the Institute, and every number has a control beside it. If you would rather learn this properly from the beginning, the Institute runs an AutoCAD course for construction that covers blocks and layouts in full.

A dynamic block library is already on your machine

This is the part almost nobody mentions. The AutoCAD installer ships a sample set with it. Counted on the machine, there are 13 files in the folder below.

C:\Program Files\Autodesk\AutoCAD 2027\Sample\en-us\Dynamic Blocks\

Six disciplines, two unit systems each, plus one file of leader tools.

FileMetricImperial
ArchitectureArchitectural - Metric.dwgArchitectural - Imperial.dwg
StructuresStructural - Metric.dwgStructural - Imperial.dwg
CivilCivil - Metric.dwgCivil - Imperial.dwg
ElectricalElectrical - Metric.dwgElectrical - Imperial.dwg
MechanicalMechanical - Metric.dwgMechanical - Imperial.dwg
AnnotationAnnotation - Metric.dwgAnnotation - Imperial.dwg
LeadersMultileader Tools.dwgshared

People hunting for a dynamic block library usually end up downloading packs of unknown origin. This one comes from Autodesk with the software, opens straight away, and raises no licensing questions.

Opening Architectural - Metric.dwg we counted 12 block definitions, 9 of them dynamic. Getting them into your own drawing works exactly as it does for ordinary blocks: open the sample file, copy what you want, paste it across. Inserting and managing blocks is covered in our article on blocks in AutoCAD.

Where to start the commands

The table below was read out of the acad.cuix interface file of the 2027 release on the machine, not written from memory.

CommandAliasRibbonClassic menu
BEDITBEHome → Block → EditTools → Block Editor
BCLOSEBCnonenone
BSAVEBSnonenone
BPARAMETERPARAMnonenone
BACTIONACnonenone
BVSTATEBVSnonenone
RESETBLOCKnonenonenone

Only the BEDIT command has a button. The other six have to be typed, and RESETBLOCK has no alias either, so that is all ten letters every time.

Call BCLOSE or BSAVE from outside the editor and the reply is verbatim:

** BCLOSE command only allowed in Block Editor. **

Creating dynamic blocks in AutoCAD from the command line

Most tutorials tell you to double-click a block and work through the dialog. There is a tidier route, measured on the 2027 release: the hyphenated -BEDIT runs entirely on the command line and opens no dialog at all.

StepWhat the machine asks, verbatimWhat you do
1Command:Type -BEDIT and press Enter
2Enter block name or [?]:Type the block name, e.g. Door Elevation - Metric
3The Block Editor opens; BLOCKEDITOR goes from 0 to 1
4Command:Type PARAM to add a parameter, choose Linear
5Command:Type AC to add an action, choose Stretch
6Command:Type BCLOSE
7Enter option [Save/Discard changes] <Save>:Type S to save or D to discard

Step seven deserves a pause. We opened the Block Editor and left again without changing a thing, and the machine still asked that question. So BCLOSE always asks, and the default inside the angle brackets is Save. Anyone in the habit of pressing Enter to get past prompts has just agreed to overwrite the block definition.

Inside the editor, a count returned 20 objects belonging to that door definition. That is the whole thing: geometry, parameters and actions together. Edit any of it and every reference of that name in the drawing follows.

The two commands worth remembering when creating dynamic blocks in autocad are BPARAMETER and BACTION. The parameter says what is being measured; the action says what moves when that measurement changes. Leave either one out and the block sits still.

Value sets, or why typing 850 gives you 800

This is the trap that makes people think the software is broken. You type a number into a parameter, the machine takes a different one, and nothing warns you.

Value sets on a dynamic block Photo: Six tests on the Width parameter, measured on AutoCAD 2027

The cause is a value set. Autodesk defines it in one sentence on the About Specifying Value Sets for Dynamic Blocks page for the 2027 release: "A value set is a range or list of values specified for a parameter".

That page says the values are limited, but it does not say what happens when you type something outside the list. So we measured it. The Width parameter of the sample door accepts exactly six values: 600, 700, 750, 800, 900 and 1000.

You typeThe machine takesWhy
900900Positive control: a listed value is kept
300600Below the floor, clamped to the smallest
74075010 away from 750, 40 away from 700
76075010 away from 750, 40 away from 800
850800Equidistant from 800 and 900; the machine takes the lower
15001000Above the ceiling, clamped to the largest

The 850 row is the one to remember: on a tie, the smaller value wins. No documentation states this, Autodesk's own page included.

The practical reading is simple. If you type a width and the door jumps to a different number, the block is not broken, it is locked to a list. Getting another size means editing that list inside the Block Editor, not typing harder.

Editing a dynamic block without wrecking the drawing

There are two levels of edit, and confusing them causes most of the accidents.

The light level changes the parameters of one reference in the drawing, by dragging a grip or typing into the Properties palette. Nothing else is touched. The heavy level means opening the Block Editor and changing the definition, and every reference of that name changes with it.

RESETBLOCK returns a reference to its default. Autodesk describes it in one line: "Resets one or more dynamic block references to the default values of the block definition". Its only prompt is Select objects:.

The phrase default values of the block definition is easy to skim past, so we put numbers on it.

What was just doneWidth parameter
The reference as the drawing opened900
Set by hand down to 600600
Run RESETBLOCK800
Negative control: set 600 again and do not reset600

RESETBLOCK is not an undo button. It did not return the 900 the reference started with; it returned the 800 written into the definition. Anyone using it to "go back to how it was" loses precisely the thing they meant to keep.

One more detail confuses newcomers. Select a dynamic reference and read its entity data, and the block name comes back as *U8, not Door Elevation - Metric. That is the anonymous name AutoCAD generates per variant; the real one lives in the effective-name property. Any lisp that filters blocks by ordinary name will therefore miss dynamic blocks entirely, which our article on counting blocks in AutoCAD goes into.

To stop other people opening the Block Editor, set BLOCKEDITLOCK to 1. Measured on our machine the default is 0, so it is open to everyone. The safest habit while editing a dynamic block is to copy the definition to a new name and edit the copy, rather than the one already in use; our article on editing a block in AutoCAD sets out the options.

Exploding a dynamic block: what is left afterwards

Plenty of people explode a block to get at it quickly. We measured what actually survives.

Before exploding, the drawing held 9 block references. Running EXPLODE on one dynamic reference left 8 block references, and the last object created was a DIMENSION.

In other words, exploding a dynamic block does not leave a heap of loose lines the way people expect. It returns exactly what the reference contained in its current state: lines, dimensions, and nested blocks if the definition had any.

What does disappear is every parameter. After the explode there is no grip to drag and no value set. Getting them back means building a new block from scratch, so explode only when you are certain nothing more needs adjusting.

Does saving to an old DWG format lose the dynamic behaviour?

This claim gets repeated constantly and measured almost never. We saved the sample file down to AutoCAD 2000 format and opened it again.

What was doneFormat codeFile sizeDynamic definitions on reopening
Original fileAC1024205,805 bytes9
Saved to AutoCAD 2000AC1015386,762 bytes9, all 5 parameters intact
Control: saved to 2018AC1032187,660 bytes9

The result runs against the common claim: the dynamic data stays inside the 2000-format file, and AutoCAD 2027 reads all of it back. What it costs is size, with the file swelling from 205,805 to 386,762 bytes, an increase of 88%.

The limit of the measurement is worth stating plainly. We reopened the file with the 2027 release, having no machine running AutoCAD 2000 to check against, so the claim is only that the data survives inside the file. Whether a genuine 2000 release could interpret it is something we did not measure and will not guess at.

Three things people say that are not true

What people sayWhat the 2027 release actually does
You must double-click through a dialog to reach the Block Editor-BEDIT goes straight there, asking Enter block name or [?]:
RESETBLOCK restores what the reference had before you edited itIt restores the definition default; measured at 800, not 900
Saving down to an old format kills dynamic blocksThe AC1015 file still reopened with 9 dynamic definitions intact

There is not much to fear here. A dynamic block rests on two ideas: a parameter that measures something and an action that moves with it. Once those two are clear, the rest is habit.

Frequently asked questions

What is the alias for the Block Editor?

BE. To avoid the dialog, type -BEDIT and give the block name on the command line.

Why does the door jump to a different width from the one I typed?

The parameter is locked to a value set. The machine takes the nearest listed value, and on a tie it takes the smaller one.

Is RESETBLOCK an undo command?

No. It returns the reference to the default stored in the block definition, which can differ from what you just changed. For an undo, use U.

Where can I find sample dynamic blocks safely?

In the Sample\en-us\Dynamic Blocks folder of the installation. There are 13 files covering six disciplines.

Why does the Properties palette show the block name as *U8?

That is the anonymous name AutoCAD generates for each variant. The real name sits in the effective-name property rather than the ordinary block name.

Can an exploded dynamic block be recovered?

Not unless you press U immediately. Once exploded, the parameters are gone and the block has to be rebuilt.

About the author

TS. Đỗ Quốc Hoàng — Vice Director of the Institute of Information Technology in Civil Engineering, Hanoi University of Civil Engineering, and a specialist in software development for construction