Hi Trang,
The files I attached to my previous post are AutoLISP routines.
In order to be able to use them you have to load them with APPLOAD command. You have to load AutoLISP routine in each drawing separately unless you use Startup Suite to load them automatically.
After loading you can use new AutoCAD command, defined in these routines.
For example after loading FLATTEN-A4M.LSP you can use new FLATTEN command to flatten objects in opened DWG file.
Here is short description of FLATTEN command:
FLATTEN sets the Z-coordinates of these types of objects to 0 in the World Coordinate System:
"3DFACE" "ARC" "ATTDEF" "CIRCLE" "DIMENSION" "ELLIPSE" "HATCH" "INSERT" "LINE" "LWPOLYLINE" "MTEXT" "POINT" "POLYLINE" "SOLID" "TEXT"
*Why Use FLATTEN?
FLATTENing is useful in at least two situations:
1) You receive a DXF file created by another CAD program and discover
that all the Z coordinates contain small round-off errors. These
round-off errors can prevent you from object snapping to
intersections and make your life difficult in other ways as well.
2) In a supposedly 2D drawing, you accidentally create one object with
a Z elevation and end up with a drawing containing objects partly
in and partly outside the Z=0 X-Y plane. As with the round-off
problem, this situation can make object snaps and other procedures difficult.
HTH,
Maxim