This list will rename a block that you select in the drawing
(defun c:rb (/ en $bl new)
(print)
(prompt “\nPick Block to rename: \n”)
(while (not en)
(setq en (car (entsel “\nPick Block: “)))
(if (or (not en) (/= (cdr (assoc 0 (entget en))) “INSERT”))
(progn
(prompt “\nNo Block Selected, Try again!”)
(setq en nil)
) ;end progn
)
)
(setq $bl (cdr (assoc 2 (entget en))))
(setq bl “”)
(setq bl (getstring (strcat “\nNew name <” $bl “>: “)))
(setq new (strcase bl))
(if (and (/= new “”) (/= new $bl))
(progn
(command “rename” “Block” $bl new)
(prompt
(strcat “\nExisting Block ” $bl
” was succssfully renamed ”
new “.”
)
)
(princ)
) ;end progn
(progn
(prompt “\nYou must give a new name for the Block!”)
(princ)
) ;end progn
) ;end if
) ;end rb.lsp