Dimensioning eats more time than anything else when finishing a sheet, so fast dimensioning in AutoCAD is the first thing drafters go looking for a lisp to solve. Before downloading one, though, it is worth knowing that AutoCAD already has four ways to dimension in bulk, and most users know only one.
This article covers both sides. For the whole dimensioning and documentation workflow, see the AutoCAD for Construction course.
Qdim and the other three built-in commands
We typed each command on AutoCAD 2027 at the Institute and copied the prompts verbatim.
QDIM is the one that actually means fast dimensioning. Autodesk's QDIM page says what it suits: "This command is particularly useful for creating a series of baseline or continued dimensions, or for dimensioning a series of circles and arcs". Select a whole group of geometry and it dimensions the lot:
Select geometry to dimension:
Miss the selection and it says so plainly: No objects found to dimension.
The DIM command on modern releases is broader still. Its prompt shows how much it gathers into one place.
Select objects or specify first extension line origin or [Angular/Baseline/Continue/Ordinate/aliGn/Distribute/Layer/Undo]:
The two classics are still there. DIMCONTINUE asks Select continued dimension: and continues along the same dimension line. DIMBASELINE asks Select base dimension: and works from one shared origin, each dimension on its own level.
The spacing between those levels is not arbitrary: it is the DIMDLI variable multiplied by the dimension scale, DIMSCALE. Set it once and the whole drawing follows.
Inside QDIM there are nine further options few people ever open: Continuous, Staggered, Baseline, Ordinate, Radius, Diameter, Datum Point, Edit and Settings. Staggered steps the dimensions in and out, which suits a plan with several wall layers. Edit lets you add or drop points while the command is still running, instead of starting over.
Knowing all four changes how fast dimensioning in AutoCAD actually feels. Most drafters place every dimension one at a time with the plain linear command, then wonder why the sheet took all afternoon. Ten minutes spent learning which of the four suits which situation pays for itself on the first floor plan.
A lisp for the dimension chain
Those four are powerful but miss one thing Vietnamese documentation work needs: dimensioning a chain in exactly the order you pick, then adding an overall dimension below it. QDIM is quicker but the order is AutoCAD's, and it adds no overall level.
Download DNH-IIC.lsp — 5 KB, two commands.
| Command | What it does |
|---|---|
DNH | pick a chain of points, set one dimension line level, and it dimensions each span in turn |
DNHP | takes every vertex of a polyline instead, so there is nothing to click twice |
Both ask whether to add an overall dimension, and that level is pushed down by exactly one DIMDLI step of the drawing.
Why does the order matter? Because a construction sheet is read as a sequence. A run of piers and openings has to appear in the order a worker walks the wall, not the order AutoCAD happened to find the linework. Add a few stray lines in between and the machine's order becomes unpredictable, at which point fixing each dimension takes longer than placing them by hand.
The second reason is the overall level. Vietnamese documentation practice nearly always wants a total below the detail chain so a reader can check the arithmetic at a glance. No built-in command adds that line for you, so it is a separate step either way. The file here folds it into one question.
(vl-load-com)
(defun IIC-GIOI-THIEU ()
(princ "\nLisp được lập trình bởi RDSIC - Viện Tin học Xây dựng")
(princ "\nwebsite: https://iic.huce.edu.vn - Tel: 0989 427 809")
)
;; Ghi mot kich thuoc thang giua hai diem, duong kich thuoc di qua pd.
(defun IIC:DIM1 (a b pd)
;; Tien to _non: ep bo qua bat diem dang bat. Thieu no thi tren ban ve that
;; (nhieu net, nhieu diem bat) lenh an vao diem khac va kich thuoc ra khong chu.
(command "_.DIMLINEAR" "_non" a "_non" b "_non" pd)
)
;; Khoang cach giua hai lop kich thuoc: lay theo DIMDLI nhan DIMSCALE cua ban ve.
(defun IIC:BUOC ( / d s )
(setq d (getvar "dimdli") s (getvar "dimscale"))
(if (or (null d) (<= d 0)) (setq d 3.75))
(if (or (null s) (<= s 0)) (setq s 1.0))
(* d s)
)
(defun c:DNH ( / e-cu os-cu ce-cu ds p pd i n buoc tong pd2 dai )
(IIC-GIOI-THIEU)
(setq e-cu *error* os-cu (getvar "osmode") ce-cu (getvar "cmdecho"))
(defun *error* (m)
(setvar "osmode" os-cu) (setvar "cmdecho" ce-cu)
(command "_.UNDO" "_End")
(setq *error* e-cu)
(if (and m (not (wcmatch (strcase m) "*CANCEL*,*QUIT*")))
(princ (strcat "\nIIC loi: " m)))
(princ)
)
(command "_.UNDO" "_Begin")
(setq ds nil)
(while (setq p (getpoint "\nChon diem theo thu tu (Enter de dung): "))
(setq ds (cons p ds))
)
(setq ds (reverse ds) n (length ds))
(if (< n 2)
(princ "\nCan it nhat hai diem.")
(progn
(setq pd (getpoint "\nVi tri duong kich thuoc: "))
(if pd
(progn
(initget "Co Khong")
(setq tong (getkword "\nGhi them kich thuoc tong? [Co/Khong] <Co>: "))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setq i 0)
(while (< i (1- n))
(IIC:DIM1 (nth i ds) (nth (1+ i) ds) pd)
(setq i (1+ i))
)
(if (/= tong "Khong")
(progn
(setq buoc (IIC:BUOC)
dai (distance (car ds) (last ds)))
;; day lop tong ra xa them mot buoc, theo huong tu diem dau toi pd
(setq pd2 (polar pd (angle (car ds) pd) buoc))
(IIC:DIM1 (car ds) (last ds) pd2)
)
)
(princ (strcat "\nDa ghi " (itoa (1- n)) " doan."))
)
)
)
)
(setvar "osmode" os-cu) (setvar "cmdecho" ce-cu)
(command "_.UNDO" "_End")
(setq *error* e-cu)
(princ)
)
;; DNHP - lay san moi dinh cua mot duong da tuyen, theo dung thu tu dinh.
(defun c:DNHP ( / e-cu os-cu ce-cu es el ds i n pd tong buoc pd2 )
(IIC-GIOI-THIEU)
(setq e-cu *error* os-cu (getvar "osmode") ce-cu (getvar "cmdecho"))
(defun *error* (m)
(setvar "osmode" os-cu) (setvar "cmdecho" ce-cu)
(command "_.UNDO" "_End")
(setq *error* e-cu)
(if (and m (not (wcmatch (strcase m) "*CANCEL*,*QUIT*")))
(princ (strcat "\nIIC loi: " m)))
(princ)
)
(command "_.UNDO" "_Begin")
(setq es (entsel "\nChon duong da tuyen: "))
(if es
(progn
(setq el (entget (car es)) ds nil)
(foreach x el
(if (= (car x) 10) (setq ds (cons (cdr x) ds)))
)
(setq ds (reverse ds) n (length ds))
(if (< n 2)
(princ "\nDuong nay khong du hai dinh.")
(progn
(setq pd (getpoint "\nVi tri duong kich thuoc: "))
(if pd
(progn
(initget "Co Khong")
(setq tong (getkword "\nGhi them kich thuoc tong? [Co/Khong] <Co>: "))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setq i 0)
(while (< i (1- n))
(IIC:DIM1 (nth i ds) (nth (1+ i) ds) pd)
(setq i (1+ i))
)
(if (/= tong "Khong")
(progn
(setq buoc (IIC:BUOC)
pd2 (polar pd (angle (car ds) pd) buoc))
(IIC:DIM1 (car ds) (last ds) pd2)
)
)
(princ (strcat "\nDa ghi " (itoa (1- n)) " doan tu " (itoa n) " dinh."))
)
)
)
)
)
)
(setvar "osmode" os-cu) (setvar "cmdecho" ce-cu)
(command "_.UNDO" "_End")
(setq *error* e-cu)
(princ)
)
Using it, step by step
Step 1 — Load the file
Type APPLOAD, point at the file, click Load then Close. To avoid loading it again on every start, add it to the Startup Suite in that same dialog.
Step 2 — Pick the chain
Type DNH and press Enter. The prompt reads:
Chon diem theo thu tu (Enter de dung):
Click each station in the order it should read, usually left to right. Turn on endpoint snap to be safe. Press Enter when done.
Step 3 — Set the dimension line level
Vi tri duong kich thuoc:
Click a point at the level you want the whole chain to sit on. You do not have to hit an object.
Step 4 — Choose whether to add the total
Ghi them kich thuoc tong? [Co/Khong] <Co>:
Enter means yes. AutoCAD reports Da ghi 7 doan. and the overall level lands one DIMDLI step below.
When a dimension has lines but no number
This cost us half a day while building the example for this very article, so it is worth telling in full.
The most common cause is the dimension style's text style. The sample drawing we used carries five dimension styles, and all five point at one text style. Every dimension came out with full extension lines, dimension line and ticks, and not a single figure.
The test that found it: write four lines of text in four different styles and look. Three rendered normally; one drew nothing at all — even though its font file was sitting in the AutoCAD 2027 Fonts folder, and even though another style using that same font worked fine. Pointing the dimension style at a working text style fixed it.
The second cause is a span too narrow for the text. Text 250 units tall will not fit between extension lines 600 apart. AutoCAD pushes it outside, where it collides with the level below. That is exactly why the example in this article keeps its shortest span at 1200.
The third is multiplying twice. DIMTXT is multiplied by DIMSCALE. Set DIMTXT to 250 and leave the scale at 100 and the text comes out 25,000 units tall, bigger than the wall. We walked into that one too.
One more habit worth building: dimension while the geometry is still simple. A wall with its openings cut but no hatching, no furniture and no notes is far easier to pick points on than the finished sheet, and the dimensions then move with the drawing as it fills up. Leaving dimensioning to the end is what makes people reach for a lisp in the first place.
Set the layer and the style before you start
Two things to settle before clicking the first point, both of which save a lot of correction later.
The first is the layer. Dimensions belong on a layer of their own, usually called DIM. Whatever layer is current when you call the command is the layer they land on, so dimensioning while still on the beam layer buries the whole chain among the beams. After that you cannot switch them off or change their plot colour separately.
The second is the dimension style. Do not rely on whatever came with someone else's drawing, because you do not know which scale it was built for. Pick a standard of your own and check three figures: text height, arrow size, and the spacing between levels. All three are multiplied by DIMSCALE, so one variable moves the whole drawing to the right plot scale.
In the example above the wall sits on the wall layer, the openings on the opening layer, and the dimensions on a red DIM layer. The three groups are distinguishable at a glance, which is how a set that leaves the office should look.
Three things often repeated that are not true
| Often repeated | What the 2027 release does |
|---|---|
| Bulk dimensioning needs a lisp | QDIM does it, and the DIM command gathers Baseline and Continue too |
| A dimension with no figure means a corrupt drawing | Usually the style's text style, or a span too narrow for the text |
| Level spacing has to be set by eye | It is DIMDLI multiplied by DIMSCALE, set once for the whole drawing |
Frequently asked questions
Does a lisp replace QDIM?
It complements it. QDIM is quicker when you simply want a group of geometry dimensioned. A lisp suits the case where reading order matters, or where an overall level is required.
What is the continuous dimension command?
DIMCONTINUE, whose first prompt is Select continued dimension:. On modern releases you can also reach it from the Continue option inside DIM.
The levels came out too far apart, or too close.
Change DIMDLI. The real distance is DIMDLI multiplied by DIMSCALE, so count both.
I picked the wrong point in the chain.
Type U once. The whole pass is wrapped as a single undo step.
Why did the text jump outside the extension lines?
Because the span is narrower than the text. Widen the span, reduce DIMTXT, or allow text outside with the DIMTIX variable.
Which layer should dimensions go on?
A layer of their own, usually DIM, so they can be switched off or replotted as a group. Layer management is covered in our article on layers in AutoCAD, and text height and extension lines in our article on dimensions in AutoCAD.