There is a Flatten script file for AutoCAD.
Users of AutoCAD who are working with entities that are not on the same Z plane axis will have trouble TRIMMING and EXTENDING them.
The script file to FLATTEN all of the entities' Z coordinates to zero is attached.
Type SCRIPT <enter> at the command line in AutoCAD, look for FLAT.SCR file and load it.
To download just click this FLAT.SCR filed.
All of the entities' Z values will be reset to 0.00 by the systems.
Enjoy.
For AutoCAD info https://acad.my
or