• 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

TEXTRANK LISP: Align and Equispace Single-Line Text

August 3, 2026

TEXTRANK aligns a group of single-line text objects onto a common line, optionally equispacing them at a chosen multiple of the text height. Pick a scattered set of labels and they snap into a tidy column.

What TextRank does

Alignment is perpendicular to the text’s own rotation, so rotated text aligns along its own axis rather than being forced to horizontal.

Two modes, chosen at the spacing prompt. Press Enter and the text is aligned but each object keeps its existing position along the line — use this to straighten a column that is already correctly spaced. Enter a factor and the text is aligned and equispaced at that multiple of the text height. A factor of 1.5 gives one and a half line spacing, which is a common annotation standard.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Position the anchor text where you want the column to start — see below.
  3. Type TEXTRANK.
  4. Select the text. Select last the object whose rotation should set the alignment axis.
  5. Press Enter to align only, or give a spacing factor to equispace as well.

How it works

The first object in the sorted order — the one furthest along the alignment axis — is treated as the anchor and does not move. Everything else lines up to it. So position that one where you want the column to start before running the command.

Knowing which object stays put is the difference between one run and three: get the anchor right and the column lands where you intended first time.

Notes and limits

  • The routine assumes every text object in the selection shares the same rotation, and takes its alignment axis from the last object selected. A mixed-rotation selection will not behave.
  • Single-line text. For MText and for live dragging, use TEXTRAIL.
  • The furthest-along object is the anchor and does not move.
  • Spacing is a multiple of text height, so it stays proportionate at any size.

Download and details

NameTextRank — align and optionally equispace single-line text
DownloadTextRank.lsp — 9.0 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandTEXTRANK
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size9.0 KB, 214 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoThe whole operation is wrapped in a single undo group, so one U reverses all of it.
CompatibilityAutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer.
AuthorYZ, August 2026
LicenceFree to use, supplied “as is” with no warranty.

References

  • TEXTRAIL LISP — dynamic alignment by dragging, including MText and curves
  • TEXTCLONE LISP — match the formatting across the aligned column
  • Text heights in drawings — the height the spacing factor multiplies
  • More free AutoLISP routines on this site
  • Wisey’s Steel Shapes — free structural steel section drawing program

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