PEDIT can insert a vertex, but only by walking the vertex list one step at a time until you reach the right segment. VERTINJECT puts a vertex where you click, and keeps prompting so several can be added in one go.
What VertexInject does
The polyline looks completely unchanged afterwards — which sounds obvious and is the entire difficulty.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
VERTINJECT. - Click on the polyline where the vertex should go.
- Keep clicking to add more. Press Enter to finish.
How it works
Splitting a straight segment is trivial. Splitting one that has width and curvature is not, because both have to be divided so the polyline looks identical afterwards.
Width interpolates linearly. If a segment tapers from 5 to 15 and you split it a third of the way along, the new vertex takes width 5 + (a third of 10) = 8.33, and the two halves then run 5-to-8.33 and 8.33-to-15.
Curvature does not. It is stored as a bulge, which is the tangent of one quarter of the arc’s included angle. Bulge does not divide linearly, so it has to be converted back to an angle, split in proportion, and converted to a bulge again:
angle = atan(bulge) one quarter of included angle
firstHalf = tan(fraction × angle)
secondHalf = tan((1 - fraction) × angle)
Get this wrong and an arc segment silently collapses to a straight line — which is exactly the bug that version 1.1 of the original was released to fix, on the closing segment of a closed polyline.
Notes and limits
- LWPolylines. Heavy polylines and 3D polylines are a different object.
- Width and curvature are both preserved, which is the whole point of the routine.
- It keeps prompting, so several vertices can be added in one command.
- One undo group covers the run.
Download and details
| Name | VertexInject — insert a new vertex into a polyline at a picked point |
| Download | VertexInject.lsp — 10.0 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | VERTINJECT |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 10.0 KB, 222 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
- PARTOFFSET LISP — the same bulge arithmetic, splitting a section to offset
- SEGREPORT LISP — report every segment, width and bulge included
- WIDTHTRACE LISP — turn a wide polyline into a real outline
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program