Editor's Note: This tip was updated in July 2015. The tip author explains that the new version uses the up-in-the-screen Text Editor, and Alerts for unacceptable inputs, rather than operating from the Command line.
One of Kent Cooper's previous tips, "Rename a Pasted Block (#3751)", allows users to pick an existing block in an AutoCAD drawing and rename it. Although it should work for any block, it was primarily created to allow for easy renaming of blocks that are pasted into a drawing.
What if you could intercept the action of pasting in a block and rename it on the fly? That is what this routine does. If you ensure it is loaded at startup by something like acaddoc.lsp, you can all but eliminate the wacky, random, automatically created block names like A$CFG5D32S.
If you want to test this before adding it to your startup code, manually load the LISP file, then copy some drawing entities to the clipboard using the CopyClip or CopyBase command. Next use the PasteBlock command (this routine replaces the built-in PasteBlock command), and it will prompt you for a file name. If you enter a block name already in use, it will ask you again until you enter an unused name. Great job, Kent.