;| FIXLINES.LSP -- Moves endpoints of all LINE objects to 0 elevation. (c) 1998 Tee Square Graphics Most AutoCAD releases, including R14 and R14.01, contain a bug that can cause the endpoints of some LINEs in 2D drawings to be moved out of the Z=0 plane. This seems to happen, for example, when some Polylines are exploded. FIXLINES will locate any line endpoints not in the Z=0 plane, and correct them so that they will respond correctly to Fillet and similar commands. |; (defun C:FIXLINES (/ ss n ent p1 p2) (setq ss (ssget "x" (list (cons 0 "LINE"))) n (sslength ss) i 0) (while (> n 0) (princ (strcat "\r" (itoa i) " line" (if (= i 1) " " "s ") "fixed. ")) (setq n (1- n) ent (entget (ssname ss n))) (setq p1 (cdr (assoc 10 ent)) p2 (cdr (assoc 11 ent))) (if (or (/= (car (reverse p1)) 0.0) (/= (car (reverse p2)) 0.0)) (progn (setq p1 (list (car p1)(cadr p1) 0.0) p2 (list (car p2)(cadr p2) 0.0) ent (subst (cons 10 p1)(assoc 10 ent) ent) ent (subst (cons 11 p2)(assoc 11 ent) ent) i (1+ i)) (entmod ent)))) (princ) )