;;; Select Arc+ Dimension Blocks
;;; Modified by Igal Averbuh 2016
;;; Based on: http://www.cadtutor.net/forum/showthread.php?89306-Lisp-to-select-blocks-using-wildcard

(defun c:dbs ( / i p s )
(setq p "DIM*" ;; Block name pattern
p (strcase p)
)
(if (setq s (ssget "_X" (list '(0 . "INSERT") (cons 2 (strcat "`DIM*," p)))))
(repeat (setq i (sslength s))
(if (not (wcmatch (strcase (LM:blockname (vlax-ename->vla-object (ssname s (setq i (1- i)))))) p))
(ssdel (ssname s i) s)
)
)
)
(sssetfirst nil s)
(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)
(c:dbs)

Advertisements