PDEC LISP: Change Text Decimal Precision (Free AutoLISP Download)
PDEC reformats the numeric value of selected TEXT entities to a fixed number of decimal places (1 through 4, chosen at runtime), giving a drawing uniform decimal precision even when the original text arrived with mixed precision from different sources.
PREC-bgol (Change Text Decimal Precision)
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 fixed-decimal-precision text formatting utilities used in survey/CAD 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
PDEC reformats the numeric value of selected TEXT entities to a fixed number of decimal places (1 through 4, chosen at runtime), giving a drawing uniform decimal precision even when the original text arrived with mixed precision from different sources.
How to Use
- Load
PREC-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
PDECat the command line and press Enter. - Enter the desired decimal precision (a whole number from 1 to 4) at the prompt.
- Select the numeric TEXT entities to convert, then press Enter to confirm.
- Each selected text's numeric value is reformatted to the chosen decimal precision. A small reference tick mark is placed above each updated text on layer
BGOL-PDEC(colour magenta) for a quick visual audit.
Why Use It
- Consistency, ensures all numeric text in a drawing displays the same decimal precision, meeting project drafting standards.
- Flexibility, one command handles any of the four common precision levels, chosen interactively instead of needing four separate commands.
- Time Savings, reformats many text entities at once instead of manually editing each one's displayed decimal count.
Where to Use It
- Standardizing elevation, coordinate, or dimension text precision across a survey or engineering drawing before final submission.
- Cleaning up numeric text imported or calculated from multiple sources (instruments, spreadsheets, other LISPs) that may carry inconsistent decimal precision.
- Any drafting task requiring uniform numeric display precision per project specification.
Notes
- Non-numeric text in the selection set is silently skipped and not counted in the reported total.
- Values are rounded (not truncated) to the requested precision via standard
rtosformatting. - 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
PDEC is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Non-numeric text in the selection set is silently skipped and not counted in the reported total.
Consistency, ensures all numeric text in a drawing displays the same decimal precision, meeting project drafting standards.
Yes. PDEC 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 PREC-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type PDEC 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.