Try adding the following to the bottom of your code: (defun AT:GetSel (meth msg fnc / ent) ((eq 7 (getvar 'errno)) (setq good (prompt "\nMissed, try again."))) ((setq good (eq 52 (getvar 'errno))) nil) (setq good (cond ((or (not fnc) (fnc ent)) ent) Ex: (AT:GetSel entsel "\nSelect arc: " (lambda (x) (eq (cdr (assoc 0 (entget (car x)))) "ARC"))) fnc - optional function to apply to selected object msg - message to display (nil for default) meth - selection method (entsel, nentsel, nentselp) (defun AT:GetSel (meth msg fnc / ent good) '(Insertionpoint Rotation XEffectiveScaleFactor YEffectiveScaleFactor (vlax-for x (setq ss (vla-get-activeselectionset *AcadDoc*)) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) (princ "\nSelect blocks to be repalced: ") (setq blk (vlax-ename->vla-object (car x))) (/= 4 (logand (cdr (assoc 70 (entget (tblobjname "LAYER" (cdr (assoc 8 e)))))) 4)) (eq "INSERT" (cdr (assoc 0 (setq e (entget (car x)))))) (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,"))) (and f *AcadDoc* (vla-endundomark *AcadDoc*))
Size and Rotation will be taken from original block and original will be deleted Replace multiple instances of selected blocks (can be different) with selected block Select the blocks that you want replaced.Select the block that you want to replace the other selected blocks.has made an awesome LISP routine called BRE.lsp to accomplish just that. This tool is helpful for replacing blocks globally (through out the entire drawing) but what if you need to simply replace a few selected blocks?…Īlan T. The Express Tool called “Replace Block” or command line = BLOCKREPLACE has been mentioned and found on the ribbon (as seen below)