eplisp

AutoCAD Insert Block on Line LISP for Single-Line Diagrams

Inserts a block on a line, aligned with it, and opens a gap in the line for the block.

Commands: BLOCKONLINE

Load the downloaded .lsp file with the APPLOAD command in AutoCAD or GstarCAD, then type the command name. How to load a LISP file

Download all tools in one file (138 KB)

BLOCKONLINE is an AutoCAD insert block on line LISP made for single-line diagrams, where breakers, switches and meters sit directly on the line. Click a point on a line and the block is inserted there, rotated to match the line, and the line is broken to the width of the block, with no separate BREAK and ROTATE steps.

The picked point is first projected onto the line so the block sits exactly on it, and the gap is opened equally on both sides. The rotation is adjusted so the symbol always reads to the right or upward, never upside down. You can keep inserting the same block on different lines until you press Enter.

How to use it

  1. Load blockonline.lsp with APPLOAD and run BLOCKONLINE.
  2. Type the block name, or type P and pick a sample block.
  3. Enter the gap length (block width) and the block scale.
  4. Pick the line at the point where the block goes, and repeat for each block.
  5. Press Enter to finish.

Notes and tips

  • Works on LINE objects only; explode polylines first if your diagram uses them.
  • The gap is opened equally on both sides of the picked point, so the block's insertion point should be at the center of the symbol.
  • Enter a gap of 0 to insert the block without breaking the line. Blocks go on the current layer.

Frequently asked questions

Why does the block sit off-center in the gap?

The block's insertion point is probably at one end of the symbol. The gap is symmetric around the picked point, so open the block in BEDIT and move its base point to the center.

Can I use it on polylines?

No, it accepts LINE objects only and warns if you pick anything else. Explode the polyline into lines first.