erdevelop_ / courses / autocad-dinamik-blok / en TR Glossary Tools
Courses · AutoCAD Dynamic Blocks

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.

7 days~3.5 h a dayEnglishTürkçesi

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

DayTopicWhat you learnTime
Day 1Block EditorDynamic block logic, parameters and actions, editor, base point, units, Test Block~3.5 h
Day 2Linear and StretchStretch frame, value sets, Move, Scale, Polar, Array, Chain Actions~3.5 h
Day 3Flip and VisibilityRotation, Flip, Alignment, visibility states~3.5 h
Day 4Lookup and Block TableType lists, reverse lookup, driving from a table~3.5 h
Day 5Parametric constraintsGeometric and dimensional constraints, Parameters Manager, expressions, constraints in blocks~3.5 h
Day 6FieldsObject fields, m² conversion, FIELDEVAL, title block fields, BlockPlaceholder, table formulas~3.5 h
Day 7Data and libraryData 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.

DAY 01

Block Editor

~3.5 h · 0/5 checks

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)

BRK_100BRK_150BRK_200classic: 3 blocksdynamic: 1 block + grip
Classic and dynamic block.

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)

ParameterLinear: LengthActionStretchGeometryright end extendsgrip + property (Distance1)
The parameter defines what changes, the action what happens.

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)

Ribbon: Geometric | Dimensional | Visibility | Test Block | Save | CloseAuthoringParametersActionsParam. SetsConstraintsLengthstretch frame
Block Editor (schematic): palette, ribbon and drawing area.
  1. Create a block definition (BLOCK) or select an existing one → BEDIT (double-click also opens it).
  2. Block Authoring Palettes (BAUTHORPALETTE): Parameters, Actions, Parameter Sets (parameter + ready-made action), Constraints tabs.
  3. The editor ribbon: Geometric and Dimensional constraints (day 5), Visibility (day 3), Test Block, Save Block, Close Block Editor.
  4. 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)

  1. 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.
  2. Block unit: the unit of the block definition (millimetres). It ensures correct scaling when inserted into a drawing with different units (INSUNITS).
  3. 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)

DAY 02

Linear and Stretch

~3.5 h · 0/5 checks

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)

Length = 1000frameextended; end hole moved
Linear + Stretch: objects inside the frame move, crossing ones stretch.

Example: the side view of an aluminium profile as one block with variable length.

  1. Draw the profile 1000 mm long, base point at the left end.
  2. Linear parameter from the left end to the right end; name it Length (Properties > Distance Name).
  3. Set the parameter's Number of Grips to 1: a grip only at the right end.
  4. 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.
  5. 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)

3006500Increment: 10 mm steps, min 300, max 65003000450060006500List: stock lengths
Value set: Increment and List.

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)

300Array: column offset 300 mm, grows with Length
Array action: more holes as the length grows.
  1. Add holes to the profile; link an Array action to the Length parameter, Column offset: 300 mm (hole spacing). The number of holes grows with the length.
  2. Chain Actions: if a parameter is inside another action's selection set, should its own actions run when that action runs? Chain Actions = Yes makes "when the length changes, also trigger the action of the second parameter".
  3. 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)

DAY 03

Flip and Visibility

~3.5 h · 0/5 checks

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)

reflection linerightleft (mirrored)
Flip: one block, two hands.

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)

StateVisibleB100_Planplan, arm 100B100_Sideside, arm 100B150_Planplan, arm 150B150_Sideside, arm 150B200_Planplan, arm 200B200_Sideside, arm 200B150_Side
Visibility states, chosen with the triangle grip.

A Visibility parameter defines visibility states inside one block; different objects are visible in each state.

  1. Place a Visibility parameter in the editor (one per block).
  2. Ribbon Visibility States → new states: B100_Plan, B100_Side, B150_Plan, B150_Side, B200_Plan, B200_Side.
  3. In each state: select objects that should be hidden → Make Invisible (BVHIDE); visible ones → Make Visible (BVSHOW).
  4. With Visibility Mode (BVMODE) on, hidden objects appear faded, which makes editing easier.
  5. 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)

DAY 04

Lookup and Block Table

~3.5 h · 0/5 checks

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)

ArmHeightType (Lookup)10080B100150100B150200120B200Allow reversed lookupB150 selectedArm 150, Height 100
Lookup table and reverse lookup.

A lookup links a list choice to several parameter values.

  1. Add two Linear parameters to the block: Arm (with Stretch) and Height (with Stretch). Give both a List value set: Arm 100, 150, 200; Height 80, 100, 120.
  2. Lookup parameter + Lookup action.
  3. Double-click the Lookup action → Property Lookup Table: Add Properties to add Arm and Height as inputs.
  4. Fill in the rows:
Arm Height Type (Lookup)
100 80 B100
150 100 B150
200 120 B200
  1. Set the setting below the lookup column to Allow reversed lookup: when the user picks B150 from the list, Arm becomes 150 and Height 100.
  2. 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)

TypeArmHeightThicknessB100100804B1501501005B2002001206row = type; column = parameter
Block Table.

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).

  1. In the editor click Block Table → pick a location and the number of grips.
  2. Add parameters and user parameters as table columns.
  3. Each row is a type; add a name column (e.g. Type).
  4. In the drawing, pick a row with the table grip, or from the list in Properties.
  5. 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)

DAY 05

Parametric constraints

~3.5 h · 0/5 checks

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)

HorizontalHorizontalVerticalVerticalFixAUTOCONSTRAINcoincident, horizontal,vertical, perpendicular added
Geometric constraints: rectangle + one fixed corner.

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)

Width = 1500Division = 500Height = 3000
Dimensional constraints (named).

Parametric > Dimensional (DIMCONSTRAINT): Linear, Horizontal, Vertical, Aligned, Angular, Radial, Diameter.

  1. A constraint gets a name and a value: d1 = 1200. Give it a meaningful name: Width = 1200.
  2. Change the value → the geometry changes, respecting the geometric constraints.
  3. 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)

NameExpressionValueWidth15001500Count3 (user)3DivisionWidth / Count500Height2 * Width3000
Parameters Manager: expressions and a user parameter.

PARAMETERS command (Parametric > Manage > Parameters Manager):

  1. Lists all dimensional constraints and user parameters.
  2. A constraint's expression can be calculated from other parameters: Division = Width / Count.
  3. Add a user parameter: Count = 3.
  4. Some available functions: sqrt, abs, round, floor, ceil, sin, cos, tan, d2r (degrees to radians), r2d, the constant pi.

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)

DAY 06

Fields

~3.5 h · 0/5 checks

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)

Sourcepolyline, file, blockFieldexpression + formatMTEXTA = 4.50 m²
Field: the value comes from the source and is shown in the text.

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.

  1. FIELD command, or right-click > Insert Field inside MTEXT (Ctrl+F).
  2. Fields show with a grey background (not plotted); turn it off with FIELDDISPLAY.

2. Object fields (1 hour)

15003000P-124.50 m²SettingValuePropertyAreaFormatDecimal, 0.00Conversion factor0.000001Suffix m²1500 × 3000 = 4,500,000 mm² → 4.50 m²
Object field: polyline area in m².

Example: the panel's area in its tag.

  1. Draw the panel as a closed polyline: 1500 × 3000 mm.
  2. In the tag text: Insert Field > Objects > Object → select the object (the polyline) → Property: Area.
  3. Format: Decimal, precision 0.00; Additional Format → Conversion factor 0.000001 (mm² → m²), Suffix m².
  4. Result: 1500 × 3000 = 4,500,000 mm² × 0.000001 = 4.50 m².
  5. 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)

Project%<Title>%File%<Filename>%Saved%<SaveDate>%Drawn by%<Author>%Scale%<Scale>%Plotted%<PlotDate>%
Title block filled by fields (schematic; real field codes look different).
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)

LENGTH = 2650ATTDEF: LENGTHField: BlockPlaceholder> LengthLinear: Length
BlockPlaceholder: the block writes its own length.

To make a dynamic block write its own size as an attribute:

  1. Open the profile cut block (day 2) with BEDIT.
  2. Define an attribute with ATTDEF: tag LENGTH.
  3. In the default value use Insert Field → Objects > BlockPlaceholder → property: Length (the Distance name of the Linear parameter).
  4. 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)

DAY 07

Data and library

~3.5 h · 0/10 checks

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)

SourcedrawingBlocksselectPropertiesDynamic, Attr.Combine+ CountOutputtable, Excel
Data extraction workflow.

DATAEXTRACTION (Insert > Linking & Extraction > Extract Data):

  1. New extraction → source: this drawing (or drawings in a folder).
  2. Objects: display blocks only → select the PRF_Cut and BRK_Anchor blocks.
  3. Properties: Dynamic Block (Length, Visibility1, Lookup1) and Attribute (LENGTH, CODE) categories.
  4. Refine data: combine identical rows and add a Count column → cut list.
  5. Output: an AutoCAD table in the drawing and/or an Excel/CSV file.
  6. 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)

  1. One block per DWG: PRF_Cut.dwg, BRK_Anchor.dwg; in a shared network folder.
  2. Naming standard: a prefix shows the category (PRF profile, BRK bracket, TAG tag, TTL title block).
  3. Offer them to users with Tool Palettes (Ctrl+3) or DesignCenter (Ctrl+2); the Blocks palette (BLOCKSPALETTE) shows recent blocks and libraries.
  4. 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.
  5. 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).

4. Final exercise (1 hour)

PRF_CutBRK_AnchorP-12TAG_PanelBlockLengthCountPRF_Cut265012
Final exercise: three blocks and a cut list.

End-of-day check (15 min)