Homeโ€บ Blogโ€บ STG LISP: Snap Text to Nearest Grid Point Free Download
๐Ÿ“ LISP

STG LISP: Snap Text to Nearest Grid Point Free Download

๐Ÿงฎ 1  |  ๐ŸŸข 1
28 Feb 2026 Trishunya Team
STG LISP: Snap Text to Nearest Grid Point Free Download
๐Ÿ“ LISP · CAD UTILITIES

STG LISP: Snap Text to Nearest Grid Point (Free AutoLISP Download)

๐Ÿ“… 28 Feb 2026 ๐Ÿท๏ธ CAD BGBgol Global
STG AutoLISP routine, Snap Text to Nearest Grid Point, shown inside a CAD window

STG snaps the insertion point of selected TEXT entities (typically elevation labels) onto the nearest point of a regular grid, defined by a chosen grid spacing. Many downstream survey/GIS/terrain-modeling programs expect point data to sit exactly on regular grid coordinates, this routine cleans up scattered or imprecisely placed text so it conforms.

SNAPGRID-bgol (Snap Text to Nearest Grid Point)

CATEGORY
Land Survey Lisps
COMMAND NAME
STG
LISP FILE
SNAPGRID-bgol.lsp
LICENSE
Open-source, free

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 grid-snapping utilities used in survey and GIS 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

STG snaps the insertion point of selected TEXT entities (typically elevation labels) onto the nearest point of a regular grid, defined by a chosen grid spacing. Many downstream survey/GIS/terrain-modeling programs expect point data to sit exactly on regular grid coordinates, this routine cleans up scattered or imprecisely placed text so it conforms.

How to Use

  1. Load SNAPGRID-bgol.lsp into your CAD session (drag-and-drop the file onto the drawing window, or use the APPLOAD command).
  2. Type STG at the command line and press Enter.
  3. Select one or more TEXT entities whose insertion points are scattered/off-grid.
  4. Enter the grid spacing (e.g. 5).
  5. Each selected text's insertion point is moved to the nearest grid intersection (X and Y each rounded to the nearest multiple of the spacing), and a small marker circle is drawn at the new point on layer BGOL-STG for visual confirmation.

Why Use It

  • Meets strict grid requirements, ensures point/elevation data conforms to the grid-coordinate requirements of downstream terrain, GIS, or modeling software, avoiding rejected or misinterpreted imports.
  • Cleans up scattered labels, turns visually scattered or inconsistently placed text into a neat, regular grid layout in one operation across many texts at once.
  • No manual calculation, removes the need to manually calculate and re-enter each text's snapped coordinate by hand.

Where to Use It

  • Preparing elevation/point data exports for grid-based terrain, GIS, or modeling software that requires strictly gridded input.
  • Cleaning up manually digitized or imported drawings where text labels ended up slightly off the intended regular grid.
  • Any drafting QA step ensuring elevation label positions are grid-consistent before further processing or export.

Notes

  • Rounding uses standard round-half-up logic on both X and Y independently (e.g. a text at X=23.45, Y=34.56 with a grid value of 5 snaps to (25, 35)).
  • The text's Z (elevation) value, string content, height, and style are left unchanged, only the X/Y insertion point is modified.
  • A confirmation marker circle is placed at each new snapped location on BGOL-STG so you can quickly verify the result visually.
  • 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

What CAD platforms does STG work on?

STG is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.

What should I know before using STG?

Rounding uses standard round-half-up logic on both X and Y independently (e.g. a text at X=23.45, Y=34.56 with a grid value of 5 snaps to (25, 35)).

What is the main benefit of using STG?

Meets strict grid requirements, ensures point/elevation data conforms to the grid-coordinate requirements of downstream terrain, GIS, or modeling software, avoiding rejected or misinterpreted imports.

Is STG free to use for commercial projects?

Yes. STG is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.

How do I load the STG command into my drawing?

Drag and drop SNAPGRID-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type STG 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.

Back to all articles