[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.
ALSPSOL1107: Insert Blocks - Transformation Matrix
Tip# ALSPSOL1107 By Tony Hotchkiss On 01-Nov-2007
4
Rated By 1 users Downloaded : 1122
Categories : Export, Databases, Blocks, Import, Object Data
Software type : AutoCAD
Rename File To : Tip ALSPSOL1107: INSBLK4.LSP
INSBLK4.LSP uses a transformation matrix to add blocks that automatically include part numbers, quantity, vendor, and description.

Rich Smith e-mailed me a request asking how to add blocks to an AutoCAD drawing using a transformation matrix to place the blocks in the correct position and orientation. In his scenario, a series of block names and values of a 4x4 transformation matrix are to be input from a comma-delimited (CSV) file.

The AutoLISP Solution is INSBLOCK4.LSP. The routine requests the location of the CSV file and reads the name of the drawing (block) to be inserted and 16 values representing the 4x4 transformation matrix for any number of blocks. The blocks are then inserted and transformed to their final x, y, and z locations and orientations in the current drawing.

Get the Code
Download the INSBLOCK4.LSP file from Cadalyst's Get the Code! site and save it in AutoCAD's Support directory. Use the Appload facility by selecting Tools / Load Application and then use the browser to select INSBLOCK4.LSP.




 

 

Average Rating:
4


User comments