eplisp

AutoCAD Sum Numbers in Text LISP: Total, Average, Min, Max

eplisp, the free multilingual LISP library

Sum Numbers in Text
Written by eplisp; available in English and Turkish.
…
Rate this tool:
CommandsTXTSUM
CategoryMeasuring and Totals
Authoreplisp
LicenseFree (eplisp)
Version2.0.0
RequirementsAutoCAD, GstarCAD
Prompt languageEnglish / Turkish
Filestxtsum.lsp (16 KB)
Download

Adds up the numbers in selected texts, reports average, minimum and maximum, and can write the total into the drawing.

TXTSUM is an AutoCAD sum numbers in text LISP that adds up the numbers written in your drawing. Instead of typing room areas, elevations, load labels or quantity notes into a calculator, select the texts and get the total, average, minimum and maximum directly.

Download txtsum.lsp16 KB · Free
Commands: TXTSUM

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 eplisp tools in one file (138 KB)

Overview

The first number in each text is used, so 'Living room 26.4 sq m' gives 26.4. Both a decimal point and a decimal comma are accepted, and a leading minus sign is respected. Texts without a number are skipped and the count of skipped texts is reported. After the results are shown, click a point to write the total into the drawing with the current text height and layer, or press Enter to skip.

How to use it

  1. Load txtsum.lsp with APPLOAD and run TXTSUM.
  2. Select the TEXT and MTEXT objects that contain numbers and press Enter.
  3. Read the count, total, average, minimum and maximum on the command line.
  4. Click a point to write the total into the drawing, or press Enter to skip.

Notes and tips

  • Only the first number in each text is read, so '2x36W' gives 2.
  • Numbers with thousands separators are misread: '1,250.50' is taken as 1.25. Remove thousands separators first.
  • In formatted MTEXT, digits inside formatting codes (font, height) can be picked up; plain TEXT or unformatted MTEXT gives reliable results. Block attributes and dimensions are not selected.

Frequently asked questions

Can I use it to add up room areas?

Yes. Select labels like 'Kitchen 135 sq ft' and the first number in each is used. If a label contains another number before the area, such as a room number, that number is taken instead, so make sure the area comes first.

How is the total written into the drawing?

As a single-line TEXT at the current TEXTSIZE on the current layer, with no decimals if the total is a whole number and two decimals otherwise.

Found a mistake, or are you the author of this tool? Request a correction or removal