;;; Highlights lines that are slightly skewed from horizontal & vertical ;;; By Eric Boehlke ;;; http://truevis.com ;;; design@truevis.com (defun c:skewedp (/ txtset total test ename alist test update next fuzz-ask type) (defun update (/ pt10 pt11 pt10x pt11x pt10y pt11y skewedp) (setq pt10 (cdr (assoc 10 alist)) pt11 (cdr (assoc 11 alist)) pt10x (nth 0 pt10) pt11x (nth 0 pt11) pt10y (nth 1 pt10) pt11y (nth 1 pt11)) (print ename) (princ "Xs: ") (princ pt10x) (princ " ") (princ pt11x) (princ " Ys: ") (princ pt10y) (princ " ") (princ pt11y) (if (setq skewedp (or (and (equal pt10x pt11x fuzz) (not (equal pt10x pt11x fuzz2))) (and (equal pt10y pt11y fuzz) (not (equal pt10y pt11y fuzz2))))) (redraw ename 3)) (if skewedp (princ " Skewed!")) (setq test (1+ test) ename (ssname txtset test)) (if ename (setq alist (entget ename)))) (defun next () (setq test (1+ test) ename (ssname txtset test)) (if ename (setq alist (entget ename)))) (setq fuzz2 0.0000001) (if (not fuzz) (setq fuzz 0.2)) (setq fuzz-ask (getdist (strcat "\nMaximum checking distance. <" (rtos fuzz) ">: "))) (if fuzz-ask (setq fuzz fuzz-ask)) (prompt (strcat "\nLines will be highlighted if ends are different less than " (rtos fuzz 2 7) " and different more than " (rtos fuzz2 2 7))) (setq txtset (ssget) total (sslength txtset) test 0 ename (ssname txtset 0)) (if ename (setq alist (entget ename))) (while (< test total) (setq type (cdr (assoc 0 alist))) (if (= "LINE" type) (update) (next))) (princ))