shadow
Computer
- Mar 1, 2001
- 321
ok well i have found 2 or 3 lisps that do this but dont exactly work the way i want them to i will post the one that i have now that actually counts for me now but what im looking for is one that gives me name of block then the layer that its on how many are on that layer and then if there are more on another layer list that layer and how many that is on it and continues on to the next one
the lisp i have now currently you give the block name it returns the entire drawing amount but nothing else or you can pick a block it will tell you the nam and how many there are in the drawing but like i said im looking for more something that i can just window in an area and it tell me the following
Block Name Layer Amount
if anyone wants it this is the block count routine i have
(defun c:cntblks ()
(setvar "cmdecho" 0)
(setq blkname (getstring "\nType block name or <enter> to pick: ")
(if (= blkname ""
(setq blkname (cdr (assoc 2 (entget (car (entsel))))))
)
(setq blockset (ssget "X" (list (cons 2 blkname))))
(setq total (sslength blockset))
(if (= total 1)
(progn
(princ "\n "(princ "\n "(princ "\n "(princ "\n "
(textscr)
(princ "\nThere is "(princ total)(princ " block called "(princ blkname)(princ"...."
(princ "\n "(princ "\n "
)
)
(if (> total 1)
(progn
(princ "\n "(princ "\n "
(princ "\n "(princ "\n "
(textscr)
(princ "\nThere are "(princ total)(princ " blocks called "(princ blkname)(princ"...."
(princ "\n "(princ "\n "
)
)
(setvar "cmdecho" 1)
(princ)
)
if everyone helps everybody the world will be a better place
the lisp i have now currently you give the block name it returns the entire drawing amount but nothing else or you can pick a block it will tell you the nam and how many there are in the drawing but like i said im looking for more something that i can just window in an area and it tell me the following
Block Name Layer Amount
if anyone wants it this is the block count routine i have
(defun c:cntblks ()
(setvar "cmdecho" 0)
(setq blkname (getstring "\nType block name or <enter> to pick: ")
(if (= blkname ""
(setq blkname (cdr (assoc 2 (entget (car (entsel))))))
)
(setq blockset (ssget "X" (list (cons 2 blkname))))
(setq total (sslength blockset))
(if (= total 1)
(progn
(princ "\n "(princ "\n "(princ "\n "(princ "\n "
(textscr)
(princ "\nThere is "(princ total)(princ " block called "(princ blkname)(princ"...."
(princ "\n "(princ "\n "
)
)
(if (> total 1)
(progn
(princ "\n "(princ "\n "
(princ "\n "(princ "\n "
(textscr)
(princ "\nThere are "(princ total)(princ " blocks called "(princ blkname)(princ"...."
(princ "\n "(princ "\n "
)
)
(setvar "cmdecho" 1)
(princ)
)
if everyone helps everybody the world will be a better place