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
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
RESPACE. - Pick the text lines in the order they should read.
- 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
| Name | TextRespace — set a run of text lines at an even spacing |
| Download | TextRespace.lsp — 7.9 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | RESPACE |
| Requires | nothing beyond a CAD platform with AutoLISP. |
| Source size | 7.9 KB, 189 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | The whole operation is wrapped in a single undo group, so one U reverses all of it. |
| Compatibility | AutoCAD (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. |
| Author | YZ, August 2026 |
| Licence | Free 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