TrimIn_TrimOut_Boundary

Short description

Rectangle-based AutoLISP trim and erase utility for keeping or removing geometry inside or outside a selected boundary.

Image 000 33

Command:

CUT
SCB
SC
SCD

Description:

TrimIn_TrimOut_Boundary is an AutoLISP boundary-cleanup routine based on the enhanced multi-trim SECTION workflow by Bob Jones with a dialog interface added by Jim Arthur. It prompts the user for two rectangle corners and then trims and erases geometry either outside or inside the rectangle.

The command can leave a rectangular polyline border, trim outside while deleting the temporary border, or delete and trim geometry inside the rectangle depending on the selected operation.

Helper function: (if any)​

c:cut launches the dialog-based workflow and routes the chosen option.
c:scb runs section with a retained rectangular border.
c:sc runs section without retaining the border.
c:scd deletes/trims entities inside the selected rectangle.
section builds the rectangular boundary, computes trim-fence points, performs erase and trim command calls, and restores system variables.
newerr restores CMDECHO and HIGHLIGHT after cancellation or error.
cut_x loads cut.dcl, reads the selected option, and executes the matching command.

Functionalities:

Allows the user to define a rectangular boundary from two corner points.
Offers three trimming modes: outside with border, outside without border, and inside deletion.
Creates a temporary closed PLINE rectangle used as the trim boundary.
Uses AutoCAD ERASE and TRIM operations to remove and cut geometry relative to the rectangle.
Uses four fence trim passes around the boundary to improve trim reliability.
Saves and restores CMDECHO and HIGHLIGHT system variables.

Result:

The drawing is trimmed or cleaned according to the selected rectangular operation. Depending on the mode, the routine either leaves a visible rectangular polyline border or removes the temporary border after trimming.

Images, animations etc.

Image 000 33
Pixel

XAML code:

ο»Ώ<ResourceDictionary
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
 
 <src:RibbonToolTip x:Key="TrimIn_TrimOut_Boundary">
 <src:RibbonToolTip.ExpandedContent>
 <StackPanel>
 <TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: cut / scb / sc / scd</Bold>
<LineBreak/>
<Bold>Version: 1.1 Date: 28.04.2026 3:17:47PM</Bold>
<LineBreak/>
<Hyperlink>https://blog.draftsperson.net/free-lisp-routines/</Hyperlink>
<LineBreak/>
<RichTextBox>
    <FlowDocument>		
        <Paragraph>
            <Bold>Program Description</Bold>
<LineBreak/>
The first command, SCB, will erase and trim all entities outside of the rectangle and leave a polyline border.
<LineBreak/>
The second command, SC, will erase and trim all entities outside of the rectangle but will not leave a border. 
<LineBreak/>
The final command, SCD, will erase and trim all entities inside of the rectangle and will not leave a border.
<LineBreak/>
        </Paragraph>
		    </FlowDocument>
</RichTextBox>
</TextBlock>
            
<Grid>
<Image Source="Image_000.jpg" Stretch="Uniform"/>
</Grid>

 
 <!-- Use MediaElement for GIF (static first frame) and Image as fallback -->
</StackPanel>
 </src:RibbonToolTip.ExpandedContent>
 </src:RibbonToolTip>
 

 
</ResourceDictionary>

Additional info:

Share this page:

Leave a Reply

Page Tag: 🏷️ CAD Automation

  • TrimIn_TrimOut_Boundary

    β€”

    by

    Short descriptionRectangle-based AutoLISP trim and erase utility for keeping or removing geometry inside or outside a selected boundary. Command:CUT SCB SC SCD Description:TrimIn_TrimOut_Boundary is an AutoLISP boundary-cleanup routine based on the enhanced multi-trim SECTION workflow by Bob Jones with a dialog interface added by Jim Arthur. It prompts the user for two rectangle corners and…

  • NCopyExtra

    β€”

    by

    Short descriptionAutoCAD AutoLISP / Visual LISP tool for copying geometry from XREF drawings into the host drawing, with dialog-driven XREF selection, rectangle/window filtering, optional debug reporting, XREF layer-name cleanup, layer property transfer, and a classical nested-object copy mode. Command:NCopyExtra NCopyExtraD NCopyExtraW NCopyExtraI ClassicalNCopy Description:NCopyExtra is an AutoCAD AutoLISP utility designed to copy objects from attached…

  • LenCalc

    β€”

    by

    Short descriptionπŸ“Š Dialog-driven AutoCAD AutoLISP length calculator that summarizes geometry length by layer, linetype, or color and exports the result to AutoCAD tables, TXT, or CSV. Command:LenCal Description:πŸ“Š LenCalc is a dialog-based AutoCAD AutoLISP length calculator for quantity takeoff and drawing audit workflows. πŸš€ The command scans supported curve entities, groups total lengths by Layer,…

  • SwapBlockAssignLayer

    β€”

    by

    Short descriptionSwapBlockAssignLayer is an AutoCAD AutoLISP utility that replaces selected drawing objects with instances of an existing named block, using a DCL block selector and remembered last-used block choice. Command:SwapBlockAssignLayer Description:πŸš€ SwapBlockAssignLayer is an AutoCAD AutoLISP block replacement tool for converting selected drawing entities into inserted block references. The command prompts the user to select…