Pick a piece of text, pick a curve, and the text follows your cursor along that curve — always the right distance from it, always turned to match the curve’s direction at that exact point, always the right way up.
What TrackText does
This is the pipe label that has to sit above the pipe and run with it, the road name along a bend, the contour value on a contour, the flow arrow annotation on a duct. Placing one by hand means MOVE, then ROTATE with a reference angle picked off two points on the curve, then nudging it clear — and doing it again every time the curve is edited.
Anything the curve functions understand works as a track: lines, arcs, circles, ellipses, splines, polylines and xlines. The curve may be nested inside a block or an xref.
Controls: + and - change the offset, O types an exact one, < and > rotate 45°, R types an exact rotation, Y toggles readability, B toggles the background mask, Enter finishes.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Run
TRACKSETonce to choose the text type, justification, default offset, readability and whether to copy rather than move. - Type
TRACKTEXT. - Pick the text, or type a new one. Pick the curve.
- Slide along the curve and click to place. In multiple text mode every click drops a copy and starts another.
How it works
The command runs inside a grread loop. On every mouse move the closest point on the curve to the cursor is found; the text is placed on the line from that point towards the cursor at a fixed distance — the offset factor multiplied by the text height; and it is rotated to that direction less ninety degrees, which lines it up along the curve rather than across it.
That middle step is what makes the behaviour feel right. The cursor chooses where along the curve and which side, but never how far away. Wave the mouse from one side of a pipe to the other and the label flips across, keeping its clearance.
Because the offset is a multiple of the text height rather than an absolute distance, it looks identical at any drawing scale.
Readability. Text aligned to a curve is upside-down for half of that curve. With readability on — the default — any angle that would put the text between 90° and 270° is rotated a further 180°, so it always reads left to right. Press Y to switch it off when you want the text to follow the curve literally.
Nested curves. The curve functions cannot measure an object inside a block reference, because its coordinates are in the block’s own space. So TrackText reads the transformation matrix nentselp returns, rebuilds a temporary copy of the curve in world coordinates, and tracks along that. The copy is stripped of its layer, colour, linetype and lineweight so it cannot disturb anything, and it is deleted when the command finishes — including if the command errors.
A polyline vertex needs special handling: picking one returns the vertex rather than the polyline, so the vertex’s owner is used instead.
Notes and limits
- The offset is proportional to text height, so it looks right at any scale.
- Readability is on by default. Press
Yif you genuinely want text following the curve upside-down. - Nested and xref curves work, via a temporary world-space copy that is always cleaned up.
- In multiple text mode the trailing uncommitted copy is removed when you press Enter.
Download and details
| Name | TrackText — slide text along a curve, aligned to it and the right way up |
| Download | TrackText.lsp — 52.2 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Commands | TRACKSET, TRACKTEXT |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com); nothing extra — the dialog is written to a temporary file at run time and deleted again, so there is no .dcl to install. |
| Source size | 52.2 KB, 1,219 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | Not needed — this routine only reads the drawing and changes nothing. |
| 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
- TEXTRAIL LISP — aligning a whole group of text at once
- CURVEHUG LISP — the same idea for symbols and blocks
- SPANTAG LISP — labelling each object with its own length
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program