Alert script no round-up line
I use autocad for architectural projects, and all the time I draw lines with round length (except of course diagonal lines or arcs), with a precision of centimeter so no smaller than 0.01. Sometimes when I snap to a point, for mistake autocad snaps to something very close, so close and small that I don't realise soon this mismatch. The problem is that usually I discover the wrong length much later, when I have already spread this mistake across the drawing. So, can you suggest me a script which gives me an allert when a line with a length smaller that 0.01 has been drawn?Thanks Take a bit more care with your osnap settings and turn off stuff like GRID. The following will select all lines shorter than a given length:
(defun c:shortlines ( / ent enx idx mnl sel ) (setq mnl 0.01) ;; Minimum allowable line length (if (setq sel (ssget "_X" (list '(0 . "LINE") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model"))))) (repeat (setq idx (sslength sel)) (setq ent (ssname sel (setq idx (1- idx))) enx (entget ent) ) (if (< mnl (distance (cdr (assoc 10 enx)) (cdr (assoc 11 enx)))) (ssdel ent sel) ) ) ) (sssetfirst nil sel) (princ))
页:
[1]