• 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

RESPACE LISP: Re-space a Column of Text at an Even Pitch

August 6, 2026

RESPACE takes a run of separate text lines and sets them at an even spacing, measured from the first one and following its rotation.

What TextRespace does

The usual need is after changing the height of a block of notes: the text is the right size but the lines are now too close or too far apart, and moving twenty of them by hand is both slow and never quite even.

Selection order is placement order, so pick them in the sequence you want them to end up in. That also means you can reverse a block by picking it bottom to top.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type RESPACE.
  3. Pick the text lines in the order they should read.
  4. Give the spacing.

How it works

The first item you select stays where it is and sets the direction. Every later item is placed one further step along, perpendicular to that first line’s baseline — straight down for horizontal text, and correctly sideways for text at any rotation.

The four-quadrant problem, solved with one line. The routine this replaces carried a fifty-line COND with a separate branch for text rotated 0–90, 90–180, 180–270 and 270–360 degrees, each computing x and y with a different combination of sines and cosines.

Worked through, all four branches are the same expression: the point reached by stepping from the first insertion point at an angle of (rotation − 90°). One branch computes x from cos(rot−90) and y from sin(rot−90); another computes x from sin(rot) and y from −cos(rot), which are the same two numbers by the angle-difference identities.

So the whole COND is one polar call — and it works at every rotation including the ones the original’s ranges left out, since exactly 90, 180 and 270 degrees each fell through a boundary between two branches.

Justification is preserved, line by line. A text object’s position lives in group 10 when it is left-justified and bottom-aligned, and in group 11 for every other justification. Working that out from the first item and applying it to all of them moves the wrong point on a mixed block, so each item is checked here — both the horizontal and the vertical justification codes.

Notes and limits

  • The first item does not move; everything follows it.
  • Pick order is placement order.
  • Any rotation works, including exactly 90, 180 and 270.
  • One undo group covers the whole run.

Download and details

NameTextRespace — set a run of text lines at an even spacing
DownloadTextRespace.lsp — 7.9 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandRESPACE
Requiresnothing beyond a CAD platform with AutoLISP.
Source size7.9 KB, 189 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

  • TAGWIDTH LISP — squeezing the same text to fit
  • TEXTRANK LISP — sorting a column of text into order
  • TEXTRAIL LISP — aligning text along a path
  • 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