• 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

Trims LISP Routine: Crop AutoCAD Drawings with SCB, SC, SCD

September 19, 2020

Last updated July 27, 2026

Trims is a free AutoLISP routine that crops an AutoCAD drawing to a rectangle in one operation. You pick two corners; the routine erases everything wholly outside that rectangle and trims back any entity that crosses the edge, or does the reverse and clears everything inside the rectangle. It is the classic tool for cutting a detail out of a larger drawing, tidying a sheet down to its final extents, or clearing a clean hole for a table or enlarged detail.

The routine is an enhanced version of Bob Jones’s SECTION Release 1.0 from 1996, with a dialog box interface added by Jim Arthur in 1997. It ships as Trims.zip, but the two files inside are actually named CUT.LSP and CUT.DCL, so do not go hunting for a file called trims.lsp after you unzip it.

What it does in practice

All three trimming commands work the same way at the start: you are asked to pick two corners of a rectangle, and the routine accepts the corners picked in any order. It then draws a temporary closed polyline along the rectangle, erases the entities entirely on the unwanted side, and runs TRIM with four fence lines placed just off the rectangle so that anything crossing the boundary is cut back to it. The three commands differ only in which side is cleared and whether the border stays:

  • SCB erases and trims everything outside the rectangle and leaves the polyline border in place.
  • SC erases and trims everything outside the rectangle and removes the border afterwards.
  • SCD erases and trims everything inside the rectangle and does not leave a border.

The routine turns off command echo and highlighting while it works and restores both when it finishes, and it includes an error handler that puts those settings back if you cancel partway through. The author notes in the file header that for very large drawings, maps for example, you may need to edit the DST figure of 1000 in the code if entities are not trimming properly.

Command reference

  • CUT opens a small dialog box titled “Trim In Trim Out” with three buttons, “Trim Out w/ Boarder”, “Trim Out No Boarder” and “Trim Inside Boundry” (the labels are spelled that way in the original), plus a Cancel button. Picking a button runs SCB, SC or SCD respectively.
  • SCB, SC and SCD can also be typed directly at the command line. Note that these three are defined inside the CUT command, so you need to run CUT at least once in the session before they will respond on their own.

How to load it

Unzip both files and keep them together. CUT.LSP loads the dialog by the file name cut.dcl, so put both files in a folder that is on AutoCAD’s support file search path. Load CUT.LSP with APPLOAD, or add it to the Startup Suite if you want it available in every drawing. When it loads you will see the message “Cut.LSP loaded – Type Cut to begin.” at the command line. If loading LISP files is new to you, the AutoLISP guide covers APPLOAD and the Startup Suite in detail.

Step-by-step usage

  • Type CUT and choose one of the three buttons in the dialog.
  • At the prompt “Select first corner of rectangle:” pick one corner of the area you want to keep or clear.
  • At “Select other corner:” pick the opposite corner. The rubber-band box shows the rectangle as you drag.
  • The routine erases and trims in one hit and returns you to the command line.

Because SC and SCB operate on everything in the drawing outside your rectangle, it is worth saving first or working on a copy, particularly the first few times you use it.

Compatibility notes

The routine was written in 1996-97 for the AutoCAD of that era. It uses plain AutoLISP plus a DCL dialog file, with no dependence on Express Tools, so it has a good chance of loading in current full versions of AutoCAD, though it has not been tested on them here.

The DCL dialog is the sticking point for AutoCAD LT users. LT gained AutoLISP support in AutoCAD LT 2024, but DCL dialog boxes are not supported on LT, and CUT is built around one, so this routine needs full AutoCAD. See what runs on AutoCAD LT for the details of that limitation.

Download

Name: TRIMS
Description: The first command, SCB, will erase and trim all entities outside
of the rectangle and leave a polyline border. The second command,
SC, will erase and trim all entities outside of the rectangle but will not
leave a border. The final command, SCD, will erase and trim all
entities inside of the rectangle and will not leave a border.
Type: AutoCAD AutoLISP Routine
Author: Bob Jones
File Size: 4 Kb
Cost: Free
Worked on: AutoCAD
Download File: Trims.zip

Related routines

  • Zero Elevation – another clean-up utility, this one for flattening stray Z values in a drawing.
  • Fixblock – tidies up problem blocks, a common companion job when you are cleaning received drawings.
  • Best of LISP collection – a grab bag of small utilities in the same spirit as this one.

There are plenty more free routines in the free LISP routine library.

References

  • AutoLISP programming guide
  • Free LISP routine library
  • What runs 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