TFRM LISP: Fitted Frame Around Text (Free AutoLISP Download)
TFRM draws a rectangle tightly fitted around each selected text entity, sized to that specific text's own width and height (plus a small margin). Unlike inserting a fixed-size block, every frame matches its text exactly, no overlap on long labels, no wasted space on short ones.
TXTFR-bgol (Fitted Frame Around 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 "fit a box around text" drafting utilities. 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
TFRM draws a rectangle tightly fitted around each selected text entity, sized to that specific text's own width and height (plus a small margin). Unlike inserting a fixed-size block, every frame matches its text exactly, no overlap on long labels, no wasted space on short ones.
How to Use
- Load
TXTFR-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
TFRMat the command line and press Enter. - Select one or more TEXT/MTEXT entities to frame.
- Press Enter to finish selection.
- A rectangle is drawn around each selected text, on a dedicated layer,
BGOL-TXTFRAME(colour blue).
Why Use It
- Precise fit, the frame is computed from each text's real bounding box, not a fixed block size.
- Time savings, draws all selected frames in one command run instead of manually drafting a rectangle per label.
- Cleaner presentation, makes key values (elevations, benchmarks, IDs) stand out consistently across the drawing.
Where to Use It
- Highlighting critical elevation values, benchmark readings, or other key numeric data in a presentation-quality drawing.
- Any drafting task needing text visually emphasized with a clean, properly fitted border, especially when label lengths vary.
Notes
- Default clearance margin is 1.0 drawing unit around each text; edit the
marginvariable near the top ofC:TFRMin the .lsp file to change it. - Frames are independent LWPOLYLINE entities, moving/erasing the source text does not move/erase its frame automatically.
- 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
TFRM is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Default clearance margin is 1.0 drawing unit around each text; edit the margin variable near the top of C:TFRM in the .lsp file to change it.
Precise fit, the frame is computed from each text's real bounding box, not a fixed block size.
Yes. TFRM 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 TXTFR-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type TFRM 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.