(defun c:countmir ( / i l n s x )
(if (setq s (ssget "_X" '((0 . "INSERT") (-4 . "<") (41 . 0.0) (-4 . ">") (42 . 0.0))))
(repeat (setq i (sslength s))
(if (setq x (assoc (setq n (LM:blockname (vlax-ename->vla-object (ssname s (setq i (1- i)))))) l))
(setq l (subst (cons n (1+ (cdr x))) x l))
(setq l (cons(cons n 1) l))
)
)
)
(foreach x l (princ (strcat "\n" (car x) "\t" (itoa (cdr x)))))
(princ)
)
;; Block Name-Lee Mac
;; Returns the true (effective) name of a supplied block reference
(defun LM:blockname ( obj )
(if (vlax-property-available-p obj 'effectivename)
(defun LM:blockname ( obj ) (vla-get-effectivename obj))
(defun LM:blockname ( obj ) (vla-get-name obj))
)
(LM:blockname obj)
)
(vl-load-com) (princ)
为李干杯。
我也试试那个。
页:
1
[2]