1、CAD中如何一次性统计多条直线(曲线)的长度1、打开记事本记录以下代码(defun c:tj_l (/ p n e e1 e2 l s x1 x2 y1 y2 xx yy ll lll) (setq ln 0 lll 0) (setq p (ssget)) ; Select objects (if p (progn ; If any objects selected (setq l 0 n (sslength p)) (while (< l n)
2、 ; For each selected object... (if (= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l)))))) (progn (setq e1 (assoc 10 e) e2 (assoc 11 e)) (setq x1 (cadr e1) y1 (caddr e1)) (setq x2 (cadr e2) y2 (caddr e2)) (setq xx (abs (- x2 x1)) yy (abs