TXZ LISP: Sync Text Caption to Z Elevation (Free AutoLISP Download)
TXZ fixes a common survey-drawing problem: elevation labels drawn as plain TEXT often sit at Z = 0 even though their caption displays a real elevation value (e.g. "484.947"). Many downstream tools read an entity's true elevation from its Z coordinate, not from what the text says, so a "zero elevation" text is invisible or wrong to those tools. TXZ reads the numeric value written in each text's caption and writes that same number into the text entity's actual Z coordinate.
TEXTELEV-bgol (Sync Text Caption to Z Elevation)
Command Type: AutoLISP routine (works in AutoCAD, BricsCAD, ZWCAD and most AutoLISP-compatible CAD platforms)
Developed by: BGol Community, bgol.in
Inspired by the general concept of "sync text-to-Z" elevation utilities used in CAD/survey drafting. This is an original, independently written routine, new file name, new command name, new source code, created so the CAD community has a free, editable, open-source alternative.
Overview
TXZ fixes a common survey-drawing problem: elevation labels drawn as plain TEXT often sit at Z = 0 even though their caption displays a real elevation value (e.g. "484.947"). Many downstream tools read an entity's true elevation from its Z coordinate, not from what the text says, so a "zero elevation" text is invisible or wrong to those tools. TXZ reads the numeric value written in each text's caption and writes that same number into the text entity's actual Z coordinate.
How to Use
- Load
TEXTELEV-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
TXZat the command line and press Enter. - Select one or more elevation-label TEXT entities (captions that are numeric elevation values, e.g. "484.947").
- For each selected text, its caption is parsed as a number and written into the entity's Z coordinate; X and Y positions are left unchanged.
- The command reports how many texts were updated and how many were skipped because their caption wasn't numeric.
- Works across many selected texts in a single command run.
Why Use It
- Synchronizes label and geometry, what a person reads matches what software reads from the entity's true 3D elevation.
- Saves manual work, no more opening Properties for every elevation text and typing in the Z value by hand.
- Enables downstream 3D workflows, surface (TIN/DTM) generation, volume calculations, and any process relying on true entity elevation now gets correct data.
- Batch operation, fixes many texts at once instead of one at a time.
Where to Use It
- Cleaning up legacy or field-imported survey drawings where elevation spot labels were drawn as flat (Z = 0) text.
- Preparing point/elevation data for surface (TIN/DTM) generation, where the software needs real Z values on the point/text entities.
- Any QA step before exporting drawing data to GIS or terrain-modeling software that trusts geometry Z over text content.
Notes
- Non-numeric TEXT captions (labels, titles, etc.) are automatically skipped and reported, so it's safe to run on a mixed selection.
- X and Y coordinates of each text are never changed, only Z is updated to match the caption.
- Source code is fully open, feel free to study, modify, and redistribute it under the same open, free-for-all spirit.
Credits
Developed and shared for the CAD community by BGol Community. Website: https://bgol.in/ Free and open-source, use it, modify it, share it, for personal or commercial work alike.
Frequently Asked Questions
TXZ is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Non-numeric TEXT captions (labels, titles, etc.) are automatically skipped and reported, so it's safe to run on a mixed selection.
Synchronizes label and geometry, what a person reads matches what software reads from the entity's true 3D elevation.
Yes. TXZ is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.
Drag and drop TEXTELEV-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type TXZ at the command line to run it.
🤝 About BGol Community
BGol Community of Advanced Surveying builds and shares free, open-source tools for the survey and CAD drafting community.
🙌 Made with ❤️ by BGol Community of Advanced Surveying
Free, open-source, and built for the CAD community, for personal or commercial use, always.