0 Members and 1 Guest are viewing this topic.
Einer 2D-Polylinie (1C8FB5) mit nur einem Kontrollpunkt wurde ein Kontrollpunkt hinzugefügt.To a 2D-polyline (..) with only one vertex was added a vertex.
(defun c:NULLP ( / bad cnt el en et fuzz pel pen pl ss tcnt) (setq cnt 0 tcnt 0 fuzz 1e-11) (princ "\n\nSearching Zero Length Polylines...") (if (setq ss (ssget "X" (list (cons 0 "*POLYLINE")))) (repeat (sslength ss) (setq en (ssname ss cnt) el (entget en) et (cdr (assoc 0 el)) cnt (1+ cnt) bad nil) (cond ((= et "LWPOLYLINE") (setq pl (mapcar 'cdr (pjk-Massoc el 10)) f (car pl) bad (or (= (length pl) 1)(apply '= (mapcar (function (lambda (x)(equal x f fuzz))) pl))) ) ) ((= et "POLYLINE") (setq pen (entnext en)) (while (and pen (= (cdr (assoc 0 (setq pel (entget pen)))) "VERTEX")) (setq pl (reverse (cons (cdr (assoc 10 pel)) (reverse pl))) pen (entnext pen) ) ) (setq f (car pl) bad (or (= (length pl) 1)(apply '= (mapcar (function (lambda (x)(equal x f fuzz))) pl))) ) ) ) (if bad (progn (entdel en)(setq tcnt (1+ tcnt)))) ) ) (princ (strcat "\nRemoved (" (itoa tcnt) ") Zero Length Polylines")) (princ))(defun pjk-Massoc (el dxf) (vl-remove-if 'null (mapcar (function (lambda (x)(if (= (car x) dxf) x nil))) el) ))
@PKENEWELLthanks a lot - works fine.In the meantime I found out that - "qselect" for "polylines with length = 0" also find these lines- "_audit" does not care about these lines (although opening a file with 1-vertex-plines stars an automatic repair)
Doesn't purge remove zero length objects?
My remarks to "purge zero-length plines"a) in 2008 it does not exist in "purge"b) for me, I need to find and select the lines, not the purge themThanks again for contributions.
...Are they being used to identify something in the imported drawing that you need?
(defun c:a (/ i k n s ss)