eplisp

Point Z from Nearest Text (T2Z)

eplisp, the free multilingual LISP library

Point Z from Nearest Text (T2Z)
Openly licensed; the original file is hosted here together with its license.
…
Rate this tool:
CommandsT2Z
CategoryOther Tools
AuthorCivilTechSource (AutoCAD Lisps 4 All)
SourceCivilTechSource/AutoCAD-Lisps-4-All
LicenseMIT
Version1.1
RequirementsAutoCAD for Windows (full version; not LT). Uses ActiveX and Windows Script Host for the confirmation dialog.
Prompt languageEnglish
FilesT2Z - Point to Nearest Text Elevation.lsp (4 KB)
Added2026-10-26
Download the original fileSource repository

Sets the Z value of selected points or blocks to the number in the nearest text and adds a small check label that shows each new elevation.

T2Z, from the AutoCAD Lisps 4 All collection by CivilTechSource, gives elevations to 2D survey data. Many drawings received from surveyors have points or level blocks at Z = 0 with the level written next to them as text; this command moves each object to the height its label states.

Overview

After a Yes/No confirmation window you select POINT objects or block references. For each one the routine looks through all TEXT and MText in the drawing, takes the one whose insertion point is closest in plan, converts its content to a number and writes it as the object's Z coordinate. Next to each updated object it creates a cyan text 'Z:value' on the layer T2Z-CHECK so the result can be reviewed.

How to use it

  1. Load 'T2Z - Point to Nearest Text Elevation.lsp' with APPLOAD.
  2. Type T2Z and click OK in the confirmation window.
  3. Select the points or blocks whose elevation should be set and press Enter.
  4. Review the Z: labels on layer T2Z-CHECK, then freeze or erase that layer.

Notes and limitations

  • Changes the Z coordinate of the selected objects; use U to undo.
  • The nearest text is searched over the whole drawing, including unrelated text: if the closest text to a point is a point number, that number becomes its Z, and text that is not numeric gives Z = 0.
  • Delete the T2Z-CHECK labels before running the command again; otherwise they can be picked as the nearest text and read as 0.
  • MText with formatting codes is usually read as 0.
  • Run time grows with the number of points times the number of texts, so large drawings can be slow.
  • Creates the layer T2Z-CHECK and leaves layer 0 as the current layer at the end.
  • The repository was published in 2026; test on a copy of the drawing first.

Source and license

This tool is not made by eplisp. The file is published unchanged under its author's license; copyright stays with the author.

References

  1. Source repository: CivilTechSource/AutoCAD-Lisps-4-All – https://github.com/CivilTechSource/AutoCAD-Lisps-4-All/tree/ebf12c27ef9903c06f5f9a57ad369f74be211316/Survey
  2. Author: CivilTechSource (AutoCAD Lisps 4 All) – https://github.com/CivilTechSource
  3. License: MIT – https://github.com/CivilTechSource/AutoCAD-Lisps-4-All/blob/ebf12c27ef9903c06f5f9a57ad369f74be211316/LICENSE

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