[Search tip detail and code files using keywords, tip number, author name, etc ]
 
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Block and Attribute Tools
Tip# 3648 By Robert Zipprich On 15-May-2011
5
Rated By 1 users Downloaded : 505
Categories : Export, LISP Code Modules, Programming Examples
Software type : AutoCAD 2012
Rename File To : XTRACT.lsp
This routine contains three block functions.

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.   
 

 

Average Rating:
5


User comments


Log In