;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; BSUBST.LSP By Michael Bulatovich February 19th, 2004 ; ; www.michaelbulatovich.ca ; ; ; ; Substitutes all selected blocks with another specified ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:bsubst (/ ss sslen next nextdata counter) (print "Choose blocks to substitute....") (setq ss (ssget)) (setq sslen (sslength ss)) (setq newbl (getstring "Specify name of substitute block:")) (if ss (setq counter 0) ) (while (< counter sslen) (progn (setq next (ssname ss counter)) (setq nextdata (entget next)) (setq nextdata (subst (cons '2 newbl) (assoc 2 nextdata) nextdata) ) (entmod nextdata) (setq counter (1+ counter)) ) ) (princ) )