Code:(defun c:blc(/ blSet filLst nameLst curLen) (defun namesExtract(selSet) (mapcar '(lambda(x)(assoc 2 x)) (mapcar 'entget(vl-remove-if 'listp (mapcar 'cadr(ssnamex selSet))))) ); end of namesExtract (princ "\n<<< Select sample blocks to count >>> ") (if(setq blSet(ssget '((0 . "INSERT")))) (progn (setq filLst(append(list '(0 . "INSERT"))(list '(-4 . "<OR")) (namesExtract blSet)(list '(-4 . "OR>")))) (princ "\n<<< Specify area(s) to count >>> ") (if(setq blSet(ssget filLst)) (progn (setq nameLst(namesExtract blSet)) (princ "\n========== COUNT REPORT ==========") (while nameLst (setq curLen(length nameLst)) (princ(strcat "\n" (cdar nameLst) " " (itoa(- curLen(length(setq nameLst (vl-remove(car nameLst)nameLst))))))) ); end while (princ "\n=========== END REPORT ===========\n") (textscr) ); end progn ); end if ); end progn ); end if (princ) ); end of c:blc



Reply With Quote


Bookmarks