RecipesDraw and lay out
How do I label every circle with its diameter in AutoCAD automatically?
Type "label each circle on layer HOLES with its diameter". cadssistant reads every circle on that layer (centre and radius), creates one TEXT entity per circle reading Ø9.0 beside it in a single batch, and reports how many it labelled. Say "as diameter dimensions" and it runs DIMDIAMETER on each instead, or "text height 2.5 on layer A-ANNO" to set the style.
Checked 2026-10-30
label each circle on layer HOLES with its diameter
Paste it into the palette, or pick it from the recipes inside the chat.
What cadssistant does
- Selects the circles on the layer and reads their centres and radii.
- Creates a TEXT entity per circle, all in one step: Ø plus the diameter to one decimal, placed beside the circle (the snippet puts it just outside the right edge), height 2.5 unless you give a number.
- Replies with the count and the height and layer it used. "Make them dimensions instead" swaps the texts for DIMDIAMETER dimensions, one command each.
The same task in AutoLISP
(progn
(setq ss (ssget "_X" '((0 . "CIRCLE") (8 . "HOLES"))) i 0 n 0)
(if ss
(repeat (sslength ss)
(setq ed (entget (ssname ss i)) i (1+ i)
c (cdr (assoc 10 ed)) r (cdr (assoc 40 ed)))
(entmake (list '(0 . "TEXT")
(cons 10 (polar c 0.0 (* 1.2 r)))
(cons 40 2.5)
(cons 1 (strcat "%%c" (rtos (* 2 r) 2 1)))))
(setq n (1+ n))))
n)Text height 2.5, placed at 1.2 × radius to the right of each centre. %%c is the diameter symbol in TEXT.
Good to know
- %%c renders as Ø in TEXT; MTEXT uses \U+2205 instead. cadssistant picks the one that matches the entity it creates.
- A 1.2 × radius offset lands inside a crowded pattern. Say "with leaders" and it places each label clear of the holes with an MLEADER.
More in draw and lay out
Command: CADSSISTANT
Works in AutoCAD 2024 and newer on Windows. Free trial, no card, no API key.
Get cadssistant