• 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

TRX LISP: Trim to a Construction Line You Never Draw

September 19, 2020

Last updated July 28, 2026

Sometimes you need to trim a group of lines back to somewhere there is nothing to trim to. A line of columns cut off at a grid line that is not drawn, a set of hatching stopped at an imaginary edge, a bundle of services trimmed to a boundary you do not want in the drawing.

The usual method is to draw a construction line, trim to it, then erase it. Three operations plus the tidying up. This routine makes it one.

What it does in practice

It asks for two points and draws an infinite construction line through them — an xline, which stretches out in both directions without end, so it will reach whatever you need to trim regardless of how far away it is. Then it starts AutoCAD’s TRIM command with that xline as the cutting edge and hands control to you to pick what to cut.

The two points define the line’s direction, so pick them to describe the angle you want to trim at. They do not need to be anywhere near the objects you are trimming; the xline extends to them.

The construction line is not meant to survive the operation. The download description says it is erased when the command finishes, which is the sensible design — you wanted a trim, not a new object.

Because the cutting edge is an xline rather than a line, it also means you cannot accidentally trim to the wrong end of a too-short cutting edge, which is the usual frustration when trimming to a construction line drawn by hand.

The command is TRX

Not “trim to point”, which is what the file and the listing are called. TRX is what you type — presumably trim-extended, or trim-xline.

Three letters, and not one AutoCAD claims, so it is a reasonably safe name to take. Worth checking against your own aliases all the same.

Check it loads before you rely on it

An honest note. The last line of the routine, where it hands control to you for the trim selection, contains an unusual construction — a backslash used in a way that is more commonly seen inside text strings than in code. The file’s brackets balance correctly, so it is not obviously broken, but it is the sort of thing that can behave differently between releases.

Load it and run it once in a scratch drawing before you use it on real work. If it loads without complaint and the trim prompt appears, you are fine. If it errors on loading, the routine is short enough that rewriting that last line is a small job.

How to load it

Unzip the download and load the .LSP file with APPLOAD. Note that the file name contains spaces, which some older loading methods dislike — APPLOAD handles it, but if you load it by typing a path, put quotes around it. Our AutoLISP guide covers loading.

Step-by-step usage

  1. Type TRX.
  2. At “Specify a point:” pick the first point the cutting line passes through.
  3. At “Specify through point:” pick the second, which sets the angle.
  4. Pick the objects to trim, on the side you want removed, as you would with any trim.
  5. Press Enter to finish.

If the construction line is still there afterwards, erase it — it is the last object drawn, so a Last selection picks it up.

Compatibility notes

No date or author in the file. It drives XLINE and TRIM, both long-standing commands, so the substance should be sound; the caveat above about the final line is the only real question mark.

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 modifies geometry, so use a copy while you satisfy yourself it behaves.

Download

Name: Trim to Point
Description: This lisp program creates a construction line based on your input
and trim the entities that you select to that construction line. To
finish this command the construction line is erased.
Type: AutoCAD AutoLISP Routine
Author: Anon
File Size: 1 Kb
Cost: Free
Worked on: AutoCAD
Download File: Trim to point.zip

Related routines

  • FZ — sharp corners, the other half of tidying up intersections.
  • BreakPoint — split an object rather than trimming it.
  • ATC — put trimmed arcs back together as circles.

References

  • AutoLISP: the complete guide
  • Free LISP routines library
  • AutoLISP on AutoCAD LT

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