AutoCAD Dynamic Blocks, Fields and Parametric Constraints
Dozens of sizes from one block: speed up facade drawings with dynamic blocks, fields that update themselves and parametric constraints. Seven days of examples with a profile cut piece, anchor bracket, panel tag and title block.
Before you start
Who is it for
Facade designers and draughtspeople who know AutoCAD basics and want to build their own block library and automate quantities and title blocks.
What you need
- AutoCAD (full version; some features are missing in LT)
- Basic AutoCAD knowledge (AutoCAD course, in Turkish)
- An example facade drawing for days 5-7
Programme
| Day | Topic | What you learn | Time |
|---|---|---|---|
| Day 1 | Block Editor | Dynamic block logic, parameters and actions, editor, base point, units, Test Block | ~3.5 h |
| Day 2 | Linear and Stretch | Stretch frame, value sets, Move, Scale, Polar, Array, Chain Actions | ~3.5 h |
| Day 3 | Flip and Visibility | Rotation, Flip, Alignment, visibility states | ~3.5 h |
| Day 4 | Lookup and Block Table | Type lists, reverse lookup, driving from a table | ~3.5 h |
| Day 5 | Parametric constraints | Geometric and dimensional constraints, Parameters Manager, expressions, constraints in blocks | ~3.5 h |
| Day 6 | Fields | Object fields, m² conversion, FIELDEVAL, title block fields, BlockPlaceholder, table formulas | ~3.5 h |
| Day 7 | Data and library | Data extraction, library setup, dynamic properties with LISP, final exercise | ~3.5 h |
Each day ends with a checklist. Your ticks are saved in this browser. If you only study on weekday evenings, the course takes about two weeks. Command names follow the English interface. Autodesk® and AutoCAD® are trademarks of Autodesk, Inc.; this page is not affiliated with Autodesk.
Block Editor
Goal
By the end of the day you will know the logic of dynamic blocks (parameter + action), the Block Editor, the authoring palettes, the base point, block units and the test window. About 3 hours.
About this course: dynamic blocks, fields and parametric constraints, with examples from facade work: profile cut piece, anchor bracket, panel tag, title block. The course is written for full AutoCAD®; some features are missing or limited in AutoCAD LT. Command names follow the English interface; in localised versions prefix them with _ (e.g. _BEDIT). Terms are in the glossary.
1. Why dynamic blocks? (30 min)
A classic block needs a separate block for every size: brackets of 100, 150 and 200 mm = three blocks. A dynamic block is one block; you change size, visibility or direction with grips or in the Properties palette. The library gets smaller and the risk of picking the wrong block drops.
2. Parameter and action (45 min)
A dynamic block has two basic parts:
| Part | Role | Example |
|---|---|---|
| Parameter | Defines what can change; creates a grip and a property (Distance1, Angle1) | Linear: "length" |
| Action | Defines what happens to the geometry when the parameter changes | Stretch: lengthen the right end |
Rule: a parameter without an action does nothing; an action needs a parameter. Some parameters (Visibility, Alignment, Basepoint) need no action.
3. Block Editor (1 hour)
- Create a block definition (BLOCK) or select an existing one → BEDIT (double-click also opens it).
- Block Authoring Palettes (BAUTHORPALETTE): Parameters, Actions, Parameter Sets (parameter + ready-made action), Constraints tabs.
- The editor ribbon: Geometric and Dimensional constraints (day 5), Visibility (day 3), Test Block, Save Block, Close Block Editor.
- An orange exclamation mark shows a parameter not linked to an action, or an action with an empty selection set.
4. Base point, units and properties (30 min)
- Base point: the point the cursor holds when the block is inserted. Choose a point that means something on site, such as the left end of a profile or the anchor hole of a bracket. A Basepoint parameter can change it in the editor.
- Block unit: the unit of the block definition (millimetres). It ensures correct scaling when inserted into a drawing with different units (INSUNITS).
- Block properties (select an empty spot in the editor → Properties): Allow exploding, Scale uniformly, Annotative.
5. Test Block (15 min)
BTESTBLOCK (Test Block on the ribbon) tries the block in a temporary window without saving: pull grips, type values in Properties. If something is wrong, close the window and fix it in the editor. Test after every parameter and action (like the "flex" habit in Revit).
End-of-day check (15 min)
Linear and Stretch
Goal
By the end of the day you will be able to use Linear, Polar, XY and Point parameters; Stretch, Move, Scale and Array actions; value sets and chained actions. Your first real block: a profile cut piece. About 3.5 hours.
1. Linear + Stretch (1 hour)
Example: the side view of an aluminium profile as one block with variable length.
- Draw the profile 1000 mm long, base point at the left end.
- Linear parameter from the left end to the right end; name it
Length(Properties > Distance Name). - Set the parameter's Number of Grips to 1: a grip only at the right end.
- Stretch action: select the parameter → the parameter point at the right end → draw a stretch frame around the right end of the profile → select objects inside and crossing the frame.
- Test: pull the right grip; the profile lengthens, the left end stays.
Stretch frame rule: objects fully inside the frame move, objects crossing it stretch, objects outside stay. If the end cut angle and holes are inside the frame, they move with the length.
2. Value set (45 min)
The Value Set of a parameter limits the values allowed:
| Type | Settings | Example |
|---|---|---|
| Increment | Dist increment, Dist minimum, Dist maximum | 10 mm steps, min 300, max 6500 mm |
| List | List of values | 3000, 4500, 6000, 6500 (stock lengths) |
While dragging, small ticks show the allowed values. If the stock length is 6500 mm, set the maximum to 6500: nobody can draw a 6600 mm piece without noticing.
3. Move, Scale, Polar (45 min)
| Action | When | Example |
|---|---|---|
| Move | Move a part with a parameter | Hole position on the profile |
| Scale | Scale a selection (usually with Linear or XY) | Tag size |
| Polar + Polar Stretch | Angle and length together | Inclined connecting arm |
For the hole position: a second Linear parameter Hole_Distance + a Move action (select the hole). Value set List: 25, 50, 75.
4. Array and chaining (45 min)
- Add holes to the profile; link an Array action to the
Lengthparameter, Column offset: 300 mm (hole spacing). The number of holes grows with the length. - Chain Actions: if a parameter is inside another action's selection set, should its own actions run when that action runs?
Chain Actions = Yesmakes "when the length changes, also trigger the action of the second parameter". - Example: the hole group at the right end is moved by a Point parameter; if that Point parameter is in the Stretch selection and Chain Actions = Yes, the hole group moves with the length.
End-of-day check (15 min)
Flip and Visibility
Goal
By the end of the day you will be able to use Rotation, Flip, Alignment and Visibility parameters. Example: an anchor bracket with left/right, plan/side views and three types in one block. About 3 hours.
1. Rotation (30 min)
Rotation parameter + Rotate action: rotates part of the block about a centre. Value set List: 0, 90, 180, 270 or Increment 15°. Example: open/closed position of a cover piece.
2. Flip (30 min)
A Flip parameter defines a reflection line; the Flip action mirrors the selection about it. Click the grip to mirror.
Instead of separate right and left bracket blocks: one block + Flip. Text (attributes and text) can be mirrored too; leave unreadable text out of the Flip selection, or add a Move that positions the text separately.
3. Alignment (15 min)
An Alignment parameter aligns the block automatically to a nearby object (line, profile edge) during insertion or with a grip. No action is needed. Example: a gasket block sitting parallel to the profile edge.
4. Visibility (1.5 hours)
A Visibility parameter defines visibility states inside one block; different objects are visible in each state.
- Place a Visibility parameter in the editor (one per block).
- Ribbon Visibility States → new states:
B100_Plan,B100_Side,B150_Plan,B150_Side,B200_Plan,B200_Side. - In each state: select objects that should be hidden → Make Invisible (BVHIDE); visible ones → Make Visible (BVSHOW).
- With Visibility Mode (BVMODE) on, hidden objects appear faded, which makes editing easier.
- Test: select the block and open the list with the triangle grip, or use Visibility1 in Properties.
Tip: state names appear in schedules and in data extraction (day 7); keep them short and meaningful.
Watch out: blocks carrying a lot of hidden geometry in visibility states get large. Instead of hundreds of states, build size variants with the lookup (day 4) or constraint (day 5) approach.
5. Visibility + other parameters (15 min)
An action also affects invisible objects. To show only the needed grips in each state, you can hide the parameter itself in that state (select the parameter → Make Invisible).
End-of-day check (15 min)
Lookup and Block Table
Goal
By the end of the day you will know the Lookup parameter and table, reverse lookup and driving a block from a product catalogue with a Block Table. Example: a bracket that takes its sizes from its type. About 3 hours.
1. Lookup table (1.5 hours)
A lookup links a list choice to several parameter values.
- Add two Linear parameters to the block:
Arm(with Stretch) andHeight(with Stretch). Give both a List value set: Arm 100, 150, 200; Height 80, 100, 120. - Lookup parameter + Lookup action.
- Double-click the Lookup action → Property Lookup Table: Add Properties to add
ArmandHeightas inputs. - Fill in the rows:
| Arm | Height | Type (Lookup) |
|---|---|---|
| 100 | 80 | B100 |
| 150 | 100 | B150 |
| 200 | 120 | B200 |
- Set the setting below the lookup column to Allow reversed lookup: when the user picks
B150from the list, Arm becomes 150 and Height 100. - Test: choose a type with the block's triangle grip.
Input values must exist in the parameter's value set; otherwise the table gives an error.
2. Block Table (1 hour)
The Block Table (BTABLE) is a newer and more flexible way to drive a block from a table; it works especially well with constraint parameters (day 5).
- In the editor click Block Table → pick a location and the number of grips.
- Add parameters and user parameters as table columns.
- Each row is a type; add a name column (e.g.
Type). - In the drawing, pick a row with the table grip, or from the list in Properties.
- To forbid values outside the table, turn on Block properties must match a row in the table.
3. Which one when? (15 min)
| Case | Suggestion |
|---|---|
| Action-based block (Stretch, Move), few types | Lookup |
| Constraint-based block, many parameters | Block Table |
| Types come from an Excel catalogue | Block Table (rows can be pasted from Excel) |
4. Practice (15 min)
Tie the bracket block to three types with Lookup, keep the plan/side visibility from day 3 and test.
End-of-day check (15 min)
Parametric constraints
Goal
By the end of the day you will be able to draw parametrically: geometric and dimensional constraints, auto-constrain, expressions and user parameters in the Parameters Manager, and using constraints inside blocks. About 3.5 hours.
1. Geometric constraints (1 hour)
Parametric tab > Geometric panel (GEOMCONSTRAINT):
| Constraint | What it does |
|---|---|
| Coincident | Two points coincide |
| Collinear | Two lines on the same line |
| Concentric | Circle / arc centres coincide |
| Fix | A point or object is fixed |
| Parallel / Perpendicular | Parallel / perpendicular |
| Horizontal / Vertical | Horizontal / vertical |
| Tangent / Smooth | Tangent / curvature continuous |
| Symmetric | Symmetric about an axis |
| Equal | Same length or radius |
AUTOCONSTRAIN adds coincident, horizontal, vertical, perpendicular and tangent constraints to the selected geometry automatically. Then put a Fix on one corner so the drawing is anchored.
Constraint icons: shown/hidden with CONSTRAINTBAR. Remove constraints with DELCON.
2. Dimensional constraints (45 min)
Parametric > Dimensional (DIMCONSTRAINT): Linear, Horizontal, Vertical, Aligned, Angular, Radial, Diameter.
- A constraint gets a name and a value:
d1 = 1200. Give it a meaningful name:Width = 1200. - Change the value → the geometry changes, respecting the geometric constraints.
- Dynamic constraints are shown on screen but not plotted; annotational constraints look like dimensions and can be plotted (CCONSTRAINTFORM).
3. Parameters Manager and expressions (1 hour)
PARAMETERS command (Parametric > Manage > Parameters Manager):
- Lists all dimensional constraints and user parameters.
- A constraint's expression can be calculated from other parameters:
Division = Width / Count. - Add a user parameter:
Count = 3. - Some available functions:
sqrt,abs,round,floor,ceil,sin,cos,tan,d2r(degrees to radians),r2d, the constantpi.
In the figure, Width = 1500 and Count = 3 → Division = 500. Set Width to 1800 and Division becomes 600.
4. Constraints inside blocks (30 min)
The same constraints can be used in the Block Editor; dimensional constraints in the editor become constraint parameters and can appear in the block's Properties (when Show properties is on). Combined with the Block Table from day 4, one block can take every size in a catalogue.
Watch out: mixing action-based (Stretch) and constraint-based approaches on the same geometry can give results that are hard to predict. Build a block either with actions or with constraints; if you must mix them, test very often.
End-of-day check (15 min)
Fields
Goal
By the end of the day you will be able to use fields: object fields (area, length), unit conversion and format, document and drawing fields (title block), formula fields, field updating and BlockPlaceholder to make a dynamic block write its own size. About 3.5 hours.
1. What is a field? (30 min)
A field is a piece of text whose value comes automatically from somewhere else: the area of a polyline, the file name, the save date, a block attribute. When the value changes, the text updates; the problem of typed numbers going stale disappears.
- FIELD command, or right-click > Insert Field inside MTEXT (Ctrl+F).
- Fields show with a grey background (not plotted); turn it off with FIELDDISPLAY.
2. Object fields (1 hour)
Example: the panel's area in its tag.
- Draw the panel as a closed polyline: 1500 × 3000 mm.
- In the tag text: Insert Field > Objects > Object → select the object (the polyline) → Property: Area.
- Format: Decimal, precision 0.00; Additional Format → Conversion factor
0.000001(mm² → m²), Suffixm². - Result: 1500 × 3000 = 4,500,000 mm² × 0.000001 = 4.50 m².
- Stretch the polyline → REGEN or UPDATEFIELD → the tag updates.
In the same way you can put a line's Length (cut length), a circle's Diameter or a dynamic block's dynamic properties such as Distance1 into a field.
3. When do fields update? (15 min)
The FIELDEVAL system variable controls on which events fields update, with bit codes: 1 open, 2 save, 4 plot, 8 eTransmit, 16 regen. Default 31 (all). Manual update: UPDATEFIELD.
4. Title block fields (45 min)
| Information | Field |
|---|---|
| File name | Document > Filename (without extension) |
| Save date | Date & Time > SaveDate (format: dd.MM.yyyy) |
| Plot date | Plot > PlotDate |
| Layout name | Other > SystemVariable > CTAB |
| Project name, author | Document > Title / Author (from DWGPROPS) |
| Scale | Objects > Object > viewport > Standard scale |
If you define custom properties such as project name and client in DWGPROPS (Drawing Properties), the title blocks on all layouts are fed from the same source. With Sheet Sets you can also use SheetSet fields.
5. BlockPlaceholder (45 min)
To make a dynamic block write its own size as an attribute:
- Open the profile cut block (day 2) with BEDIT.
- Define an attribute with ATTDEF: tag
LENGTH. - In the default value use Insert Field → Objects > BlockPlaceholder → property:
Length(the Distance name of the Linear parameter). - Save the block; when the block is stretched in the drawing, the attribute value updates with REGEN or UPDATEFIELD.
Every profile piece then carries its own cut length; the data extraction on day 7 can read this attribute.
6. Formula fields and tables (15 min)
Cells in a TABLE can hold formulas such as =Sum(B2:B10) or =B2*C2; these are fields too. You can link a cell to another object's area and build a total quantity table.
End-of-day check (15 min)
Data and library
Goal
On the last day you will extract data from dynamic blocks (data extraction), set up the library, see how to access dynamic properties with AutoLISP and complete the final exercise. About 3.5 hours.
1. Data Extraction (1 hour)
DATAEXTRACTION (Insert > Linking & Extraction > Extract Data):
- New extraction → source: this drawing (or drawings in a folder).
- Objects: display blocks only → select the
PRF_CutandBRK_Anchorblocks. - Properties: Dynamic Block (Length, Visibility1, Lookup1) and Attribute (LENGTH, CODE) categories.
- Refine data: combine identical rows and add a Count column → cut list.
- Output: an AutoCAD table in the drawing and/or an Excel/CSV file.
- The table stays linked to the source drawing; when blocks change, an update notification appears.
Example output (profile cut list):
| Block | Length | Qty |
|---|---|---|
| PRF_Cut | 2650 | 12 |
| PRF_Cut | 3000 | 8 |
| PRF_Cut | 1480 | 4 |
Cutting optimisation is done from this list (Excel Advanced, in Turkish).
2. Library setup (45 min)
- One block per DWG:
PRF_Cut.dwg,BRK_Anchor.dwg; in a shared network folder. - Naming standard: a prefix shows the category (PRF profile, BRK bracket, TAG tag, TTL title block).
- Offer them to users with Tool Palettes (Ctrl+3) or DesignCenter (Ctrl+2); the Blocks palette (BLOCKSPALETTE) shows recent blocks and libraries.
- Layers: draw objects inside the block on layer 0 with ByBlock/ByLayer colours, so the block takes the properties of the layer it is inserted on.
- After changing attributes in a block definition, apply them to existing blocks with ATTSYNC.
3. Dynamic properties with AutoLISP (30 min)
;; Lists the properties of the selected dynamic block
(vl-load-com)
(defun c:DBPROP (/ e o)
(setq e (car (entsel "\nSelect dynamic block: ")))
(setq o (vlax-ename->vla-object e))
(foreach p (vlax-invoke o 'GetDynamicBlockProperties)
(princ (strcat "\n" (vla-get-PropertyName p) " = "
(vl-princ-to-string (vlax-get p 'Value)))))
(princ))
The real name of a dynamic block is in its EffectiveName property; Name may return an anonymous name (*U12). More: AutoLISP (in Turkish).