Point Z from Nearest Text (T2Z)
eplisp, the free multilingual LISP library
| Openly licensed; the original file is hosted here together with its license. | |
… Rate this tool: | |
| Commands | T2Z |
|---|---|
| Category | Other Tools |
| Author | CivilTechSource (AutoCAD Lisps 4 All) |
| Source | CivilTechSource/AutoCAD-Lisps-4-All |
| License | MIT |
| Version | 1.1 |
| Requirements | AutoCAD for Windows (full version; not LT). Uses ActiveX and Windows Script Host for the confirmation dialog. |
| Prompt language | English |
| Files | T2Z - Point to Nearest Text Elevation.lsp (4 KB) |
| Added | 2026-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
- Load 'T2Z - Point to Nearest Text Elevation.lsp' with APPLOAD.
- Type T2Z and click OK in the confirmation window.
- Select the points or blocks whose elevation should be set and press Enter.
- 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
- Source repository: CivilTechSource/AutoCAD-Lisps-4-All – https://github.com/CivilTechSource/AutoCAD-Lisps-4-All/tree/ebf12c27ef9903c06f5f9a57ad369f74be211316/Survey
- Author: CivilTechSource (AutoCAD Lisps 4 All) – https://github.com/CivilTechSource
- 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