eplisp

AutoCAD Bill of Quantities LISP for Electrical Drawings

Counts each legend symbol across the drawing, measures cable runs and produces a bill of quantities ready for pricing.

Download boq.lsp22 KB · Free
Commands: BOQ

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)

BOQ is an AutoCAD bill of quantities LISP for electrical drawings. It pairs every block in the legend area with its nearest description text, counts how many times each of those blocks is used in the whole drawing, and adds up the length of the cable groups you choose in metres. The result is saved as a CSV file and can also be drawn into the drawing as a table.

Matching works by block name: if a block called 'LUM_36' sits next to the text '2x36W surface luminaire' in the legend, every 'LUM_36' insert in the drawing is counted under that description. Your BOQ shows readable item descriptions no matter how the blocks are named. Counting covers every top-level block insert in model space and all layouts.

Cables are grouped by layer and color. You pick one sample of each cable type, and the tool totals every LINE, ARC, LWPOLYLINE, POLYLINE and SPLINE on that layer with the same effective color. Arc segments inside polylines are measured at their true length. For ByLayer objects the layer color is used, so differently colored cables on the same layer come out as separate line items.

Lengths are converted to metres from drawing units using INSUNITS and the 1:N scale you enter. When INSUNITS is unset, drawing units are treated as millimetres. The scale is remembered for the rest of the session.

The CSV has No, Ref, Description, Unit, Quantity, Unit Price and Total columns. Ref and the price columns are left empty on purpose so you can open the file in Excel, add your item references and unit rates, and price the job there.

How to use it

  1. Load boq.lsp with APPLOAD and run the BOQ command.
  2. Enter the drawing scale as 1:1, 1:50 and so on, or press Enter to accept the value shown in brackets.
  3. Click two opposite corners around the legend; the number of block-to-item matches is reported.
  4. Pick one line of each cable type in turn, then press Enter when all types are added.
  5. Check the bill of quantities printed on the command line.
  6. Choose the name and folder for the CSV file in the save dialog.
  7. Answer Yes to draw the table, then pick its top-left corner and the text height.

Notes and tips

  • Symbols inside the legend area are counted too; if the legend is in the same drawing, subtract one of each item.
  • Blocks nested inside other blocks and blocks inside xrefs are not counted.
  • The legend area uses a crossing selection, so titles or notes that merely touch the window can be taken as the nearest text; keep the window tight around the legend table.
  • If no text is found near a legend block, the block name is used as the description.
  • Cable length is drawing units × scale × the INSUNITS factor. If you draw at full size, enter 1:1 (the English build's default).
  • Circles are not included in cable lengths. The English build writes a comma-separated CSV with a decimal point.

Frequently asked questions

Does the BOQ include prices?

No. The tool only produces quantities. The Ref, Unit Price and Total columns are left empty so you can fill them in Excel from your own price list.

How do I separate two cable types drawn on the same layer?

Cable groups are defined by layer and color together. If 12 AWG runs are yellow and 10 AWG runs are red on the same layer, pick one of each and they are listed as two separate items.

Why are my cable lengths far too long or too short?

Almost always the scale or unit setting. Length is drawing units × the 1:N scale × the INSUNITS factor. If you draft at full size, set INSUNITS to match your units and enter a scale of 1:1. The command prints the scale and units it is using at the start.

Which symbols get counted?

Only blocks whose names appear inside the legend window. Leave a symbol out of the window to exclude it, or add it to the legend with a description to include it.