This is what i'm using:
(defun c:bold ()
(vl-load-com)
(setq bname (vla-get-EffectiveName (vlax-ename->vla-object (car(entsel "\nSelect block: ")))))
(setq bname-old (strcat bname "-old"))
(setq i 1)
(while (tblsearch "block" bname-old)
(setq bname-old (strcat bname "-old" (itoa i)))
(setq i (1+ i))
); end if
(command "rename" "block" bname bname-old)
)
When I loaded the code, it didn't work. gave this message..
"Command: BOLD
Select block: renameEnter object type to rename [Block/Dimstyle/LAyer/LType/Material/multileadeRstyle/Style/Ucs/VIew/VPort]: block
Enter name for old block: G$C2336C229
Enter name for new block: G$C2336C229-oldnil"