EZB LISP: Elevate Block to Nearest Elevation Text (Free AutoLISP Download)
EZB updates the Z value (elevation) of each selected block's insertion point to match the numeric value of the nearest TEXT/MTEXT entity in the drawing. It is designed for 2D survey drawings where blocks were placed with Z = 0, and now need real elevations pulled from nearby spot-level annotations before the drawing can be used in 3D-only workflows.
ELEVBGOL-bgol (Elevate Block to Nearest Elevation Text)
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 matching blocks to nearby elevation text used in 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
EZB updates the Z value (elevation) of each selected block's insertion point to match the numeric value of the nearest TEXT/MTEXT entity in the drawing. It is designed for 2D survey drawings where blocks were placed with Z = 0, and now need real elevations pulled from nearby spot-level annotations before the drawing can be used in 3D-only workflows.
How to Use
- Load
ELEVBGOL-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
EZBat the command line and press Enter. - Select the block(s) whose elevation needs updating, then press Enter to finish selection.
- For each selected block, the routine scans all TEXT/MTEXT entities in the drawing, finds the one nearest (in plan) to the block's insertion point, and reads its numeric value.
- The block's insertion point Z is updated to that numeric value (X and Y unchanged). A small marker circle is drawn at the new position on layer
BGOL-EZB(magenta) for quick visual confirmation.
Why Use It
- Enables 3D workflows, turns a flat (Z=0) 2D drawing's blocks into properly elevated entities, a prerequisite for terrain, GIS, or BIM software that only processes true 3D data.
- Time savings, automates reading and applying nearby elevation values instead of manually checking and typing each block's Z through Properties.
- Accuracy, ties each block's elevation directly to its nearest elevation annotation, reducing the risk of mismatching a block to the wrong value.
Where to Use It
- Converting 2D survey drawings (blocks with Z=0) into 3D-ready drawings before export to or processing in 3D-only software.
- Any drawing where blocks (survey markers, fixtures, points) were placed in 2D but need accurate Z elevation matching nearby spot-level text.
- Preparing drawings for volumetric, drainage, or 3D visualization analysis that depends on correct block elevations.
Notes
- Only text whose content parses as a valid number is considered a candidate elevation label; non-numeric text is ignored automatically.
- "Nearest" is measured as 2D planar distance between the block's insertion point and each candidate text's insertion point.
- 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
EZB is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Only text whose content parses as a valid number is considered a candidate elevation label; non-numeric text is ignored automatically.
Enables 3D workflows, turns a flat (Z=0) 2D drawing's blocks into properly elevated entities, a prerequisite for terrain, GIS, or BIM software that only processes true 3D data.
Yes. EZB 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 ELEVBGOL-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type EZB 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.