Last updated July 28, 2026
PTEXT places text along a polyline path. Draw the route you want the lettering to follow — a curve, a series of straight runs, whatever the drawing needs — and the text is set out along it rather than sitting on a single straight baseline.
It is by Viji Varghese of Kerala, India, dated March 1999.
A path is more flexible than an arc
Worth comparing with the arc text routine also on this site, which is the other way of getting curved lettering here.
That one works against an arc, so the text follows a constant radius and spreads across the whole arc. This one works against a polyline, which means the path can change direction, mix straight and curved segments, and be exactly the shape you drew rather than a circular approximation of it.
On a road name following a bend, a label tracking a services run, or lettering around an irregular boundary, that difference matters. On a simple curve the arc routine is quicker to set up.
It is careful with your settings
This is the part that stands out on reading the file, and it is unusual enough to be worth crediting.
Placing text along a path means changing a lot about the drawing environment temporarily — the current layer, the angle units, the angle direction, the angle base, command echo, point display mode, blip mode and the text style. This routine saves all eight and restores every one of them, and it does the restoring from inside its error handler as well as at the normal exit.
The practical consequence is that cancelling halfway through leaves your drawing exactly as it was. Compare that with several smaller routines in this library where an escape leaves command echo switched off, or your fillet radius at zero, with nothing to tell you.
The error handler also checks a marker before restoring anything, so it only acts when this routine was genuinely the one running — a refinement most authors do not bother with.
Command reference
The file defines a single command, PTEXT.
Note that the LLP Suite on this site also contains a file called ptext.lsp. If you have loaded that collection, whichever came last wins and you may not be running the routine you think you are. Load one or the other, or rename.
How to load it
Unzip Ptext.zip and load ptext.lsp with APPLOAD, or add it to the Startup Suite. No support files. Our AutoLISP guide covers loading.
Step-by-step usage
- Draw the polyline you want the text to follow, in the direction you want it to read.
- Set the text style and layer you want the result on.
- Type PTEXT.
- Select the path and follow the prompts for the text and its sizing.
Direction matters, as with any text-on-a-path tool: a polyline drawn right to left will give you text reading the wrong way. If the result is upside down, reverse the polyline and run it again.
Compatibility notes
March 1999, so written-for rather than tested-on, though the care taken over the drawing environment suggests code that was meant to last.
Plain AutoLISP with no dialog boxes and no Express Tools calls, so nothing requires the full product; LT users on LT 2024 or later, the release that brought AutoLISP to LT, should be able to run it. See what runs on AutoCAD LT. It adds text and does not modify the path, so nothing existing is at risk.
Download
| Name: | PTEXT |
| Description: | Places text along any specified path(polyline) |
| Type: | AutoCAD AutoLISP Routine |
| Author: | Viji Varghese Kerala |
| File Size: | 3 Kb |
| Cost: | Free |
| Worked on: | AutoCAD |
| Download File: | Ptext.zip |
Related routines
- ATEXT — text along an arc, the simpler case.
- TXP — turn the finished text into polylines.
- CHGTEXT — match the height and style of the result to the rest of your annotation.