
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone!
I have the next routine which i took from the forum. Just wanted to add a new filter so it selects only the items which are inside a specific layer (_AUX-COMENT).
I tried to add an ssget, but it says: mistake, wrong point argument.
(defun C:SUM (/ ss tl n ent itm obj l)
(setq ss (ssget (8 . "_AUX-COMENT"))
tl 0
n (1- (sslength ss)))
(while (>= n 0)
(setq ent (entget (setq itm (ssname ss n)))
obj (cdr (assoc 0 ent))
l (cond
((= obj "LINE")
(distance (cdr (assoc 10 ent))(cdr (assoc 11 ent))))
((= obj "ARC")
(* (cdr (assoc 40 ent))
(if (minusp (setq l (- (cdr (assoc 51 ent))
(cdr (assoc 50 ent)))))
(+ pi pi l) l)))
((or (= obj "CIRCLE")(= obj "SPLINE")(= obj "POLYLINE")
(= obj "LWPOLYLINE")(= obj "ELLIPSE"))
(command "_.area" "_o" itm)
(getvar "perimeter"))
(T 0))
tl (+ tl l)
n (1- n)))
(command "_erase" ss "")
(alert (strcat "La longitud total es: " (rtos tl)))
(princ)
)
Thank you for your help!
Solved! Go to Solution.