Flattens entities onto the Z=0 X-Y plane in AutoCAD's world coordinate system (UCS).
This is a AutoLISP routine to flatten all 3-D entities to a plan.
Before running FLATTEN:

After running FLATTEN (type FLAT command):

Load file Flatten.lsp and type FLAT command to begin.