Robert Zipprich's submission serves to remind us that an inserted block with attributes can have different attributes than the block definition within the AutoCAD drawing Block Table. How can this be? Say you have a block named Foo in your current drawing and it contains three attributes. You also have a drawing file named Foo.DWG that contains six attribute definitions. If you insert Foo.DWG into your current drawing and redefine the block, only the block geometry is redefined, and existing insertions of the original Foo block retain their three attributes.
After you load this LISP file, there are three functions in this routine. The function named Xtract creates two files — an Attribute Template File and an Attribute Prompt File — both with the same name as the block. This function reads the selected block for its attributes. The second function, XtractT, is identical to the first except that it searches the Block table for attributes. The last function, XtrtBlk, creates a single Tab-formatted file with the attribute values of the selected block. These are all useful on their own, as well as a good starting point for building your own, more complex routines.