Greetings!
I would like to know if there is a way to list in the command box how many separate polylines are there, grouped by their linetype :)
Now it adds up the length but i would like the count.
(defun C:Csőhossz_számoló ( / SS aL i e itm ltp b )
(if
(setq SS
(ssget "_:L-I"
'((0 . "*POLYLINE")
(-4 . "<NOT")
(-4 . "<AND")
(0 . "POLYLINE")
(-4 . "&")
(70 . 80)
(-4 . "AND>")
(-4 . "NOT>")
)
)
)
(progn
(setq aL '())
(repeat (setq i (sslength SS))
(setq e (ssname SS (setq i (1- i))))
(setq itm
(cons
(setq ltp (cond ( (cdr (assoc 6 (entget e))) ) ( "ByLayer" ) ))
(+ (vlax-curve-getDistAtParam e
(vlax-curve-getEndParam e))
(setq b (cond ( (cdr (assoc ltp aL)) ) (0.))))
)
)
(if (zerop b)
(setq aL (cons itm aL))
(setq aL (subst itm (assoc (car itm) aL) aL))
)
)
(princ "\n============\n")
(foreach x (vl-sort aL ''((a b) (apply '< (mapcar 'car (list a b)))) )
(princ (car x)) (princ " : ") (princ (rtos (cdr x) 2 4))
(princ "\n")
)
(princ "============")
(textscr)
)
)
(princ)
)