HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

LSP of block statistics

2008-02-25View Original

Thread Content

;**************************************************** Block statistics (defun c:btj () (setq st t) (while st (while (not (setq st (entsel "\nSelect the blocks to be counted:")))) (if (= (cdr (assoc '0 (entget (car st)))) "INSERT") (progn (setq blockname (cdr (assoc '2 (entget (car st))))) (setq st nil) ) (princ "\nNo block selected!") ) ) (princ (strcat "\nSelect block" blockname ":")) (setq ss (ssget)) (if (= ss nil) (setq ss (ssget "x"))) (setq n 0 m 0) (while (and ss (< n (sslength ss))) (setq ssn (ssname ss n)) (if (= (cdr (assoc '0 (entget ssn))) "INSERT") (progn (setq blockname1 (cdr (assoc '2 (entget ssn)))) (if (= blockname blockname1) (setq m (+ m 1)) ) ) ) (setq n (+ n 1)) ) (alert (strcat "Block" blockname ":" (rtos m 2 0) " pieces")) (setq pt (getpoint "\nEnter the point for output:")) (if pt (command "text" pt (getvar "textsize") "0" (strcat "Block" blockname " " (rtos m 2 0) " pieces")) ) )

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.