This routine is similar to the Express Tool EXTRIM (is covered near the bottom of the linked post) in that you select a cutting edge and then what side of the cutting edge you would like to trim. But the difference is that this routine lets you select what objects that cross the cutting edge will get trimmed. With the EXTRIM command, everything that crosses the edge gets trimmed. So this routine gives you that extra amount of control.
Here’s how:
- MTR <enter> to start
- Select an object to be the “cutting edge” <enter>
- Select the objects that cross the “cutting edge” that you want trimmed <enter>
- Specify which side of the “cutting edge” the objects should be trimmed on
;;; Trims objects on one side of a cutting edge. ;;; The difference between this and the Express Tool EXTRIM ;;; is that this will let you select what objects should be ;;; trimmed. EXTRIM trims everything that crosses the edge ;;; ;;; (defun c:MTR(/ e t1 p l c) (setvar "CMDECHO" 0) (prompt "Select cutting edge(s)...") (setq e (ssget)) (prompt "Select object(s) to trim...") (setq t1 (ssget)) (setq p (getpoint"Pick side to trim...")) (command "TRIM" e "") (setq l (sslength t1)) (setq c -1) (repeat l (setq c (1+ c)) (command (list (ssname t1 c) p)) ) (command "") (prin1) ) (princ)
Pingback: AutoLISP: EXTRIM Between Two Edges | AutoCAD Tips