• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

VPTEXT LISP Routine: Scale Text to Viewport Scale in AutoCAD

September 19, 2020

Last updated July 27, 2026

VPTEXT is a small free AutoLISP routine that scales selected single-line text by a viewport scale factor you type in. It comes from an era when annotative text did not exist and drafters routinely drew text in model space at its intended paper height, then had to multiply every height up to suit the viewport scale before plotting. VPTEXT does that multiplication in one pass instead of editing each string by hand.

It was written by The CAD Guy in August 2000 and released as freeware. If you maintain older drawings where the text heights never matched the viewport, or you have inherited a model-space drawing full of paper-height text, this is the kind of quick fix worth keeping in your toolkit.

What it does in practice

The routine asks for a scale factor, asks you to select objects, then walks through the selection one entity at a time. For each entity it checks the type, and only single-line TEXT entities are touched. The current text height is read from the entity data, multiplied by your factor, and written back with entmod. Everything else in the selection is left alone, so you can safely type ALL at the selection prompt and let the routine filter for itself.

Two things follow from how it works. First, it only modifies single-line text, so MTEXT, dimensions and block attributes are not changed. Second, the scaling is a straight multiplication of the existing height, so running the command twice on the same text compounds the factor. Scale once, check the result, and only run it again if you genuinely want another multiplication.

At under forty lines, the code is also a tidy study piece. It uses a repeat loop over a selection set and edits entity association lists directly, which are exactly the techniques covered in AutoLISP lesson 8 on looping and lesson 9 on data structures.

Command reference

  • VPTEXT — prompts for a viewport scale factor, then multiplies the height of every selected single-line text entity by that factor.

That is the only command the file defines. When the file loads, it confirms itself on the command line with the message “VPTEXT Loaded…scales text to viewport scale.”

How to load it

Unzip the download and load vptext.lsp with the APPLOAD command. If you want it available every session, add it to the Startup Suite in the same APPLOAD dialog. For background on loading and managing LISP files, see the AutoLISP guide.

Step-by-step usage

  • Work in model space. The author’s notes say to enter the viewport (MS) first if you are in a layout.
  • Type VPTEXT at the command line.
  • At “Enter viewport scale factor:” type the multiplier you want. For a 1:50 viewport where text was drawn at paper height, that means entering 50.
  • At the selection prompt, pick your text objects or type ALL. Non-text entities in the selection are ignored.
  • The routine multiplies each text height and finishes. Check a couple of strings before saving.

One caution: there is no error handling in the code. If you press Enter at the selection prompt without picking anything, the routine stops with an AutoLISP error message. Nothing is harmed; just run it again and make a selection.

Compatibility notes

The author notes the routine was tested on AutoCAD R14 and AutoCAD 2000. It uses plain AutoLISP only — no dialog (DCL) files and no Express Tools functions — so there is nothing in it tied to a particular release, and code of this vintage generally still loads in current versions of full AutoCAD.

Because it avoids DCL and Express Tools calls, it should also load on AutoCAD LT 2024 or later, which added AutoLISP support. See what runs on AutoCAD LT for the details of what LT does and does not support.

Worth knowing before you reach for it: current AutoCAD handles viewport-dependent text sizing natively through annotative text. VPTEXT remains useful for legacy drawings and for anyone working with plain, non-annotative text styles.

Download

Name: VPTEXT
Description: This command scales all text in a drawing by a factor
equal to the viewport scale, which is entered by the user.
Type: AutoCAD AutoLISP Routine
Author: CAD Guy
File Size: 1 Kb
Cost: Free
Worked on: AutoCAD
Download File: Vptext.zip

Related routines

  • TXP — explode text to polylines, another single-purpose text utility.
  • ArcText, for placing text along an arc.
  • Add or subtract text, for arithmetic on numeric text in a drawing.

More free routines are catalogued in the free LISP routine library.

References

  • AutoLISP guide
  • Free LISP routine library
  • What runs on AutoCAD LT
  • AutoLISP lesson 8 — looping
  • AutoLISP lesson 9 — data structures

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in