Replacing blocks.

Is it possible to replace a single instance of a block with another one without having to redefine all the insertions of the block? As in you have a drawing
with say 200 copies of a block moved and rotated into place and are then told that a few need to be a similer but different part that is a 2nd block? Short of having to delete the wrong ones and re insert, move and rotate.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Try this.....the block that you want to use as the replacement block must exist in the drawing's block table first.
(defun c:chgblk (/ oldblk newblk ss idx obj) (vl-load-com) (and (not (eq "" (setq oldblk (getstring "\nBlock name to select: ")))) (not (eq "" (setq newblk (getstring "\nBlock name to replace with: ")))) (tblsearch "block" newblk) (setq ss (ssget (list '(0 . "INSERT") (cons 2 oldblk)))) (setq idx -1) (while (setq obj (ssname ss (setq idx (1+ idx)))) (setq obj (vlax-ename->vla-object obj)) (vla-put-name obj newblk) ) ) (princ) )

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Thanks, exactly what I needed.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.