Force Blocks to Specific Layers (Tip #2197) from Peter Jamtgaard is a magnificent set of functions that forces your block insertions to follow a specific layer standard. Two files in addition to a LISP file are included with this tip. Place the associated DCL and CSV files in a folder searched by AutoCAD. When loaded, a reactor is established that checks for Insert and MInsert command execution completion. This reactor function looks at the name of the inserted block and checks it against a list of standard layer assignments (stored in the CSV file). If the block isn't in the list of known blocks, a dialog box opens for you to set up the block-layer relationship. You also can edit the block-layer relationships by entering the command BlockLayer at the Command prompt after the LISP code has been loaded. This tip involves a lot of complex programming, reading and writing a CSV file, dialog box manipulation and reactors. As a result of all the cool coding, this tip clearly deserves to be this month's top tip. Great work, Peter! |