; Overkill in älteren Versionen, löscht 1.+Letzter Vertex-identisch NICHT, ; setzt aber Geschlossen=Nein ; Overkill in neuen Versionen(mind.2025), löscht 1.+Letzter Vertex-identisch auch NICHT, ; behält Geschlossen-Wert bei ; Overkill+ ; führt Overkill/Aufräum aus ; Löscht Letzten Vertex, falls identisch mit dem Ersten ; Löscht aller PL mit nur zwei Vertex, falls identisch mit dem Ersten (defun C:OVERKILL+ (/ ss1 ss2 n pl pldata) ; based on https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-or-native-way-to-close-polylines-that-appear-closed-but/m-p/10587668#M112403 (setvar "CMDECHO" 0) (command "_.UNDO" "_mark") ; Window-Dialog (command "CMDECHO" 1 "_.OVERKILL" (ssget) "") ; <- add/remove ";" in front of the first bracket, to disable/enable ; Commandline automation ; Start Overkill-script ;|(command "CMDECHO" 1 ; <- add/remove ";|" in front of the bracket to disable/enable "_.-OVERKILL" (ssget) "" "_Ignore" "_none" "_tOlerance" "0.000001" "_Plines" "_wiDth" "_no" "_Break" "_yes" "_yes" "_parTial" "_yes" "_Endtoend" "_yes" "_Associativity" "_yes" "_Done" )|; ; <- add/remove ";|" right of the bracket, to disable/enable (setvar "CMDECHO" 0) (if (setq ss1 (ssget "_P" '((0 . "lwpolyline")))) (repeat (setq n (sslength ss1)) (setq pl (ssname ss1 (setq n (1- n))) pldata (entget pl) ); setq (if (and (< 2 (cdr(assoc 90 pldata))) (equal (cdr(assoc 10 pldata)) (cdr(assoc 10 (reverse pldata))) 1e-6) ) (progn ; then - edit off last segment, and close (command "_.pedit" pl "_edit"); end command (repeat (- (cdr (assoc 90 pldata)) 2) (command "_next")); move to next-to-last vertex (command "_break" "_next" "_go" "_eXit" "_close" "") ); progn ); if [start/end at same place] ); repeat ) ; Just 2 vertics long (if (setq ss2 (ssget "_X" '((90 . 2)))) ;(-4 . "")))) (repeat (setq n (sslength ss2)) (setq pl (ssname ss2 (setq n (1- n))) pldata (entget pl) ); setq (if (equal (cdr(assoc 10 pldata)) (cdr(assoc 10 (reverse pldata))) 1e-6) (entdel pl) ); if [start/end at same place] ); repeat ) (command "_.UNDO" "_mark") (princ) ); defun (princ "\nOVERKILL+ loaded") (princ)