Below code shows the procedure to generate the preview icons for programmatically created blocks. Code uses AutoCAD built in command “BLOCKICON” to create the icon.