RecipesDraw and lay out

How do I place a numbered array of blocks in AutoCAD (PV modules, parking bays, seats)?

Type "Place the PANEL block 3 rows by 4, 1750 apart horizontally and 1150 vertically, starting at 0,0, numbered P1 to P12 row by row, STRING = S1". cadssistant checks that PANEL is defined in the drawing with ID and STRING attributes, works out the twelve insertion points and inserts all of them in one pass, writing ID and STRING into each block as it is placed, so there is nothing to edit afterwards. It replies with what it placed and the numbering order. Say "columns first" to number down each column before moving across. By hand, the same result is ARRAYRECT followed by editing every attribute, or the AutoLISP loop below.

Checked 2026-10-30 · one of the tasks cadssistant's models are benchmarked on

What you typeCommand: CADSSISTANT

Place the PANEL block 3 rows by 4, 1750 apart horizontally and 1150 vertically, starting at 0,0, numbered P1 to P12 row by row, STRING = S1

Paste it into the palette, or pick it from the recipes inside the chat.

What cadssistant does

  1. Reads the drawing's block list to confirm PANEL is there and carries the ID and STRING tags, then places that block.
  2. Works out the 12 insertion points: 4 columns 1750 apart and 3 rows 1150 apart, from 0,0.
  3. Inserts all twelve in one pass, writing ID (P1, P2 … P12, row by row) and STRING (S1) into each block as it lands. Nothing is exploded and no attribute is edited afterwards.
  4. Replies with the count and the numbering order. Revert in the chat removes the whole array.

The same task in AutoLISP

(progn
  (vl-load-com)
  (setq sp (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object)))
        n 1 r 0)
  (repeat 3
    (setq c 0)
    (repeat 4
      (setq o (vla-InsertBlock sp (vlax-3d-point (* c 1750.0) (* r 1150.0) 0.0) "PANEL" 1.0 1.0 1.0 0.0))
      (foreach a (vlax-invoke o 'GetAttributes)
        (cond ((= (vla-get-TagString a) "ID") (vla-put-TextString a (strcat "P" (itoa n))))
              ((= (vla-get-TagString a) "STRING") (vla-put-TextString a "S1"))))
      (setq n (1+ n) c (1+ c)))
    (setq r (1+ r)))
  (1- n))

Inserts PANEL in a 3 × 4 grid in model space and fills ID and STRING on each copy; returns how many it placed. InsertBlock adds the block's attributes with their defaults, which a bare entmake INSERT doesn't, so the values can be set by tag.

Good to know

  • Spacing is insertion point to insertion point, in drawing units: 1750 in a millimetre drawing is 1.75 m.
  • Any attributed block works. Name its tags in the sentence as they appear in the block.
  • To renumber an array that's already placed, see Renumber block tags in order.

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