<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: EXTRIM in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extrim/m-p/13653134#M56</link>
    <description>&lt;P&gt;UNFORTUNATELY, BECAUSE IT DEPENDS&lt;BR /&gt;;; LOAD EXPRESS TOOLS (2025+), THE MOST VIABLE SOLUTION WAS TO CREATE A FENCE FROM THE TRIM ATTRIBUTE, BEFORE I WAS TRYING TO FOLLOW THE EDGES OF THE RECTANGLE, BUT SINCE THE RECTANGLE IS THE SELECTION ITSELF, I JUST NEEDED A DIAGONAL, AND IT WORKED&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(command "_.PLINE" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "_C");; DRAW AN EXTRA RECTANGLE AND SAVE THE ENTITY&lt;BR /&gt;(setq rectFENCE(entlast)) ;; SAVE THE EXTRA RECTANGLE DRAWN THAT WILL BE CUT&lt;BR /&gt;(setq ssREC (ssget "F" (list p1 p3 ))) ;; FENCE SELECTION WITH CLOSED LIST&lt;BR /&gt;(if ssREC (progn (command "_.TRIM" rectFENCE "" ssREC "")));; TRIM USING THE VECTOR P1 P3&lt;/P&gt;</description>
    <pubDate>Wed, 28 May 2025 08:21:50 GMT</pubDate>
    <dc:creator>sigmmadesigner</dc:creator>
    <dc:date>2025-05-28T08:21:50Z</dc:date>
    <item>
      <title>EXTRIM</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extrim/m-p/13652561#M54</link>
      <description>&lt;P&gt;&lt;A href="https://help.autodesk.com/view/ACD/2024/PTB/?guid=GUID-06651AD3-F159-430E-81E5-AEB8E775C19E" target="_blank"&gt;AutoCAD 2024 Ajuda | EXTRIM (Express Tool) | Autodesk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GIVEN RECTANGLE THAT RECEIVES POINTS P1 P2 P3 AND P4&lt;BR /&gt;(command "_.PLINE" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "_C")&lt;BR /&gt;(setq rectEnt (entlast)) ;; saves the extra rectangle drawn&lt;/P&gt;&lt;P&gt;;finds the reference of what is the center and the external&lt;BR /&gt;cross between p1 and p3)&lt;BR /&gt;(setq ssREC (ssget "C" p1 p3))&lt;/P&gt;&lt;P&gt;;; Checks if there are objects to cut and valid rectangle&lt;BR /&gt;(if (and rectEnt ssREC )&lt;BR /&gt;(progn&lt;BR /&gt;;; Uses the rectangle as limit for EXTRIM and ssREC as reference to cut objects that will be inside the rectangle&lt;BR /&gt;(command "_.EXTRIM" rectEnt "" ssREC "")&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;any suggestions on how to make this work?&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 00:40:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extrim/m-p/13652561#M54</guid>
      <dc:creator>sigmmadesigner</dc:creator>
      <dc:date>2025-05-28T00:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: EXTRIM</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extrim/m-p/13652634#M55</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4335289"&gt;@sigmmadesigner&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should work for you. Don't forget to edit this code to include your P1-P4 point variables.&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:TEST ( / LWPoly err p1 p2 p3 p4 eRect ptTrim)
  ;; helper function
  (defun LWPoly (lst cls)
    (entmakex
      (append
        (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline")
              (cons 90 (length lst)) (cons 70 cls)
        )
        (mapcar (function (lambda (p) (cons 10 p))) lst)
      )
    );entmakex
  )
  ;; Load Express Tools (2025+)
  (acet-load-expresstools)
  ;; etrim check
  (setq err
    (not
      (or (member "ETRIM" (atoms-family 1))
          (or (load "extrim.lsp" nil)
              (member "ETRIM" (atoms-family 1))
          );or
      );or 
    );not
  );setq
  (if err
    (progn (alert (princ "\nCould not load 'etrim.lsp'.")) (exit))
  );if
  ;; ----- set your P1,P2,P3,P4 variables here -----
  ;;
  ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  (setq eRect (LWPoly (list p1 p2 p3 p4) 1))
  (setq ptTrim (polar p1 (angle p1 p3) (* 0.5 (distance p1 p3))))
  (etrim eRect ptTrim)
  (prompt "\nComplete!")
  (princ)
);defun&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 02:25:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extrim/m-p/13652634#M55</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2025-05-28T02:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: EXTRIM</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extrim/m-p/13653134#M56</link>
      <description>&lt;P&gt;UNFORTUNATELY, BECAUSE IT DEPENDS&lt;BR /&gt;;; LOAD EXPRESS TOOLS (2025+), THE MOST VIABLE SOLUTION WAS TO CREATE A FENCE FROM THE TRIM ATTRIBUTE, BEFORE I WAS TRYING TO FOLLOW THE EDGES OF THE RECTANGLE, BUT SINCE THE RECTANGLE IS THE SELECTION ITSELF, I JUST NEEDED A DIAGONAL, AND IT WORKED&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(command "_.PLINE" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "_C");; DRAW AN EXTRA RECTANGLE AND SAVE THE ENTITY&lt;BR /&gt;(setq rectFENCE(entlast)) ;; SAVE THE EXTRA RECTANGLE DRAWN THAT WILL BE CUT&lt;BR /&gt;(setq ssREC (ssget "F" (list p1 p3 ))) ;; FENCE SELECTION WITH CLOSED LIST&lt;BR /&gt;(if ssREC (progn (command "_.TRIM" rectFENCE "" ssREC "")));; TRIM USING THE VECTOR P1 P3&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 08:21:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extrim/m-p/13653134#M56</guid>
      <dc:creator>sigmmadesigner</dc:creator>
      <dc:date>2025-05-28T08:21:50Z</dc:date>
    </item>
  </channel>
</rss>

