BIM

How to shorten extension lines in AutoCAD, with or without a lisp

Shorten extension lines in AutoCAD so their feet stop at one level. Full lisp source to download, the three ways such files fail, and the built-in command.

  • TS. Đỗ Quốc Hoàng
  • 13 min read
Two different jobs that both get called cutting a dimension, and the right tool for each Photo: Diagram by the Institute of Information Technology in Civil Engineering

Wanting to shorten extension lines in AutoCAD is something nearly everyone who draws technical sheets runs into. The feet end at random heights, they run into the outline, and the sheet stops looking tidy. We wrote a small file for exactly that, ran it on AutoCAD 2027 before publishing, and printed its full source here so you can read it before running it.

This article also covers what the other pages skip: AutoCAD already has commands for two of the jobs people go hunting for a lisp to do. For the whole dimensioning and sheet workflow, see the AutoCAD for Construction course.

Two different jobs hide behind one phrase

Two quite different requests get the same name, which is why the advice you find online so often misses.

The first: the extension line length varies because each dimension attaches to a feature at a different height. You want the feet to stop at one level. This is the job the lisp file solves.

The second: the dimension line runs across other linework, and you want a gap exactly where the two cross. AutoCAD does that one itself, with no external file.

We typed both of the command names that Vietnamese tutorials quote, on AutoCAD 2027 at the Institute. Neither belongs to the software:

Unknown command "CUTDIM". Press F1 for help.

Unknown command "BD". Press F1 for help.

They are function names inside a community lisp file. Without loading that file, typing them returns the line above.

Knowing which of the two jobs you have decides everything that follows. If the feet are ragged, you want to shorten extension lines in AutoCAD, and either the style or the lisp will do it. If the line is simply crossing other geometry, no length setting helps and you want a break instead.

We read the top three search results in full. All three teach the same three button presses: type AP, point at the file, click Load. None says what the file does inside, and none mentions that the software already handles the second job.

The Institute cut dim lisp: full source, ready to download

Download CD-IIC.lsp — 3 KB, one command, CD. The source stays in the article, because running unknown code on your own machine deserves care.

(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")
  (princ "\nTel: 0989 427 809")
)

;; Doc cac ghi de kieu kich thuoc dang co cua mot dim, tra ve danh sach (ma . cap-gia-tri).
(defun IIC-DOC-GHIDE (el / cu i c ds)
  (setq cu (cdr (assoc "ACAD" (cdr (assoc -3 el)))) ds nil i 0)
  (while (< i (length cu))
    (setq c (nth i cu))
    (if (= (car c) 1070)
      (progn (setq ds (cons (cons (cdr c) (nth (1+ i) cu)) ds)) (setq i (+ i 2)))
      (setq i (1+ i))
    )
  )
  (reverse ds)
)

;; Ghi de DIMFXLON (290) va DIMFXL (49) cho RIENG mot dim.
;; GOP vao cac ghi de dang co chu khong thay het: dim thuong da mang san ghi de
;; ti le (DIMSCALE), co chu hay mau, thay het la mat sach nhung thu ay.
(defun IIC-DAT-CHAN (e dai / el ds ra)
  (regapp "ACAD")
  (setq el (entget e (list "ACAD")))
  (setq ds (IIC-DOC-GHIDE el))
  (setq ds (vl-remove-if (function (lambda (x) (member (car x) (list 290 49)))) ds))
  (setq ds (append ds (list (cons 290 (cons 1070 1)) (cons 49 (cons 1040 dai)))))
  (setq ra (list (cons 1000 "DSTYLE") (cons 1002 "{")))
  (foreach x ds (setq ra (append ra (list (cons 1070 (car x)) (cdr x)))))
  (setq ra (append ra (list (cons 1002 "}"))))
  (entmod
    (append (vl-remove-if (function (lambda (x) (= (car x) -3))) el)
      (list (list -3 (cons "ACAD" ra)))))
)

;; CD - chon cac dim roi chon MOT diem; moi chan dim se dung lai o ngang diem ay.
;; Con so do duoc KHONG doi, chi doi cho chan dim ket thuc.
;; Gop ca luot sua thanh MOT buoc hoan tac. Khong co cap StartUndoMark/EndUndoMark
;; thi moi lan entmod la mot buoc rieng: bam U mot cai chi tra lai duoc MOT dim,
;; phan con lai van bi doi. Do ngay 20/09/2026 bang cach so anh truoc/sau/hoan tac.
(defun c:CD ( / ss p i e el p10 ang v dai ti n tl )
  (IIC-GIOI-THIEU)
  (setq tl (vla-get-ActiveDocument (vlax-get-acad-object)))
  (if (setq ss (ssget (list (cons 0 "DIMENSION"))))
    (progn
      (setq p (getpoint "\nDiem cat chan dim: ") i 0 n 0)
      (if p
        (progn
          (vla-StartUndoMark tl)
          (while (< i (sslength ss))
            (setq e   (ssname ss i)
                  el  (entget e (list "ACAD"))
                  p10 (cdr (assoc 10 el))
                  ang (+ (cond ((cdr (assoc 50 el))) (0.0)) (/ pi 2.0))
                  v   (mapcar (function -) p p10)
                  dai (abs (+ (* (car v) (cos ang)) (* (cadr v) (sin ang)))))
            ;; DIMFXL bi NHAN voi ti le dim (DIMSCALE), nen phai chia truoc khi ghi.
            ;; Ban ve dung DIMSCALE 100 ma quen chia thi dat 150 hoa ra 15000 don vi,
            ;; dai hon ca chan dim, va lenh nhu khong lam gi ca.
            (setq ti (vla-get-ScaleFactor (vlax-ename->vla-object e)))
            (if (<= ti 0.0) (setq ti 1.0))
            (if (> dai 1e-6) (progn (IIC-DAT-CHAN e (/ dai ti)) (setq n (1+ n))))
            (setq i (1+ i))
          )
          (vla-EndUndoMark tl)
          (princ (strcat "\nDa cat chan cua " (itoa n) " dim."))
        )
      )
    )
  )
  (princ)
)

The idea is small. Every dimension carries its own setting for a fixed extension line length. The command measures the distance from the dimension line to the point you pick, then writes that figure into that setting for each dimension. The extension line shortens to exactly that distance, and nobody touches the measured value.

Using the command, step by step

Step 1 — Load the file into AutoCAD

  1. Type APPLOAD and press Enter. The Load/Unload Applications dialog opens.
  2. Leave Files of type on AutoCAD Apps, since .lsp belongs to that group.
  3. Browse to the folder you downloaded the file into, select CD-IIC.lsp, and click Load.
  4. Click Close. The file is now loaded for this session.
The APPLOAD dialog Photo: The Load/Unload Applications dialog on AutoCAD 2027: the Load button sits to the right of the File name box, and the Startup Suite panel with its Contents button is in the lower right corner

To avoid loading it again on every start, stay in that dialog, look at the Startup Suite panel in the lower right, click Contents... and add the file to the list. AutoCAD then loads it at startup.

Step 2 — Select the dimensions to change

Type CD and press Enter. Three credit lines from the Institute appear, then the prompt:

Select objects:

Select however you prefer: click each one, drag a window, drag a crossing window. Catching other linework does no harm, because the command only accepts dimension objects. Press Enter when done.

One thing to watch when dragging left to right: AutoCAD only takes objects that sit entirely inside the box. The extension lines reach all the way to the feature they attach to, so the box has to cover that too. Otherwise you get 0 found and assume the command is broken.

Step 3 — Pick the level where the feet should stop

Diem cat chan dim:

Click a point at the height you want every foot to stop at. You do not have to hit any object; the command only takes the distance from the dimension line to that point. AutoCAD then reports:

Da cat chan cua 3 dim.

If it goes wrong, type U

One U puts everything back. The whole pass is wrapped as a single undo step, so you do not have to press it repeatedly. We counted how many dimensions carried the override at three moments: none before the run, three after it, and none again after U.

Check one more thing after running any file of this kind: select a dimension, open the Properties palette and read its measured value again. It must be exactly what it was. If it changed, the file is dragging the origin points rather than shortening the extension lines, and you should undo before saving.

Before and after the command Photo: Top: three dimensions attached at three different heights, so the extension line feet are staggered and run into the outline. Bottom: after one call to the CD command, the feet stop at one level and the three figures 1800, 1200 and 1200 are unchanged

The point to notice is in those three figures. Before and after, the measurement is still 1800, 1200 and 1200. The command only moves where the extension line is drawn. That is the difference between shortening extension lines and dragging the origin, which quietly corrupts a whole quantity schedule.

Three ways a downloaded file gets this wrong

Three ways it fails Photo: Three faults common to the cut-dim lisp files circulating online, all three checkable on the machine

The first is scale. The fixed length setting maps to the DIMFXL variable, and the number in it is multiplied by the dimension scale, DIMSCALE. On a drawing set to 100, writing 150 straight in becomes 15,000 units, longer than the extension line itself, so the command appears to do nothing at all. We made exactly this mistake while testing, and only caught it by comparing the before and after screenshots pixel by pixel.

The second is worse: overrides. Every per-dimension setting lives in one shared block of data. Writing over the whole block wipes the text height, colour and scale set on that dimension. Our first attempt did that, and the figures and arrowheads vanished from the drawing. The published file reads the old block, replaces only the two entries it needs, and puts the rest back.

The third is security. If AutoCAD shows a Security - Unsigned Executable File box and then ; error: File load canceled:, the file is not broken. That is the SECURELOAD variable refusing to load code from a folder you have not declared as trusted. The fix and the full mechanism are in our article on calculating area in AutoCAD.

Dimension break: cutting the line where it crosses the drawing

This is the second job, and the software does it. The DIMBREAK page at Autodesk describes the command in one sentence: "Breaks or restores dimension and extension lines where they cross other objects".

Type DIMBREAK, and the prompt on the 2027 release, copied from the screen, reads:

Select dimension to add/remove break or [Multiple]:

Pick the dimension, then pick the object crossing it. The gap that appears is associative: move the geometry or the dimension and the gap follows, delete the geometry and the gap disappears. No lisp file can follow the drawing like that.

Two further details of DIMBREAK in AutoCAD are worth knowing, both listed on the Autodesk page above. The Multiple option breaks several dimensions in one pass, and the Auto option keeps the gap updated whenever the dimension or the crossing object is edited. No lisp file offers either, because only the program itself can keep a gap tied to the geometry.

Its sibling is DIMSPACE, which spaces parallel dimension lines evenly. Its first prompt is Select base dimension:. That is precisely the job the BD command does in the community files.

Fixed length extension lines, no lisp needed

If every dimension in the sheet should have the same foot length, you need no command at all. Open the dimension style dialog, go to the Extension lines tab, tick Fixed length extension lines and put a figure in the Length box. From then on every dimension carrying that style has exactly that length.

If you need to shorten extension lines in AutoCAD across a whole set of sheets, do it in the style rather than one drawing at a time. Transfer the style into the other files, or put it in the template you start from, and the question stops coming back.

Which route to take depends on the job. One convention across a whole set is better handled in the style, because new dimensions then come out right on their own. A handful of places, or several different levels, is much faster with the lisp.

The lisp wins in one respect only: it sets the value for the group you select, at a level you point at with the mouse, instead of changing the style for everything. The dialog route, and the trap that makes that box look broken, are in our article on dimensions in AutoCAD.

Three things often repeated that are not true

Often repeatedWhat the 2027 release does
CUTDIM is an AutoCAD commandTyping it returns Unknown command "CUTDIM". It is a function name inside a lisp file
Shortening the feet corrupts the measurementWe measured before and after: still 1800, 1200, 1200. Only the drawn geometry moved
Breaking a dimension where it crosses needs a lispDIMBREAK does it, and the gap even follows the geometry when you move it

Frequently asked questions

Does a cut dim lisp change the dimension value?

Not if the file is written properly. The Institute file only writes into the fixed extension line length setting of each dimension. We read all three values back before and after running it, and all three were unchanged.

The file will not load at all. What now?

Look for a Security - Unsigned Executable File box. That is AutoCAD refusing unknown code, not a broken file. Adding the folder holding the file to the trusted list lets it load.

The command ran but nothing changed. Why?

Almost certainly the drawing uses a dimension scale other than 1 and the lisp forgot to divide by it. Try again with the file from this article, which reads each dimension's own scale before writing.

Do I have to do this on every drawing?

No. If a whole set follows one convention, set it once in the dimension style. The lisp suits the case where only a group of dimensions needs shortening.

How do CD and BD differ?

CD shortens the extension lines, BD lines the dimension lines up with each other. Both are names inside community lisp files. AutoCAD has DIMSPACE for the job BD does.

Does this file work on AutoCAD LT?

This article was measured on the full AutoCAD 2027 release. Lighter editions have their own policy on running code, so test on the exact edition you use before relying on it.

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