How to flatten a drawing in AutoCAD Products

Autodesk Support

Oct 15, 2024


Products and versions covered


Issue:

Users reported that an AutoCAD drawing or some objects within it needed to be flattened, reducing their elevation or Z value to 0.
One or more of the following may not be working correctly:

  • Selecting objects.
  • Using OSNAPs (the marker jumps to the wrong place).
  • Using commands such as TRIM, EXTEND, HATCH, FILLET, JOIN, ROTATE.
  • Measurements or dimensioning for distance and angles.

Solution:

To flatten a drawing automatically in AutoCAD Products with Express Tools

Use the FLATTEN command to change the Z values of all lines, arcs, and polylines to 0.

  1. Turn off or freeze any hatch layers with hatch patterns so they are not included in the selection.
  2. Type FLATTEN on the command line.
  3. Select all objects and press the Enter key.
  4. Type N for No when prompted to remove hidden lines.
Notes:
  • Although it is possible to select and flatten everything in a drawing all at once, it might be necessary to flatten portions of content for some drawings. This can be done using the QSELECT command to select each group of object types and then run the FLATTEN command on them.
  • FLATTEN requires Express Tools to be loaded.
Express tool menu-flatten objects
For 3D objects, use the FLATSHOT or SOLPROF command to create 2D views.
  • Replace the Z value For 3D objects in layout viewports.
    1. Enter OPTIONS on the command line.
    2. On the Drafting tab > Object snap options, check Replace Z value with current elevation.
OPTIONS window-Drafting tab- Object snap options- check Replace Z value with current elevation.

Note: The FLATSHOT command runs successfully only for surfaces or solids.

To flatten a drawing manually or in AutoCAD LT

  1. Open the Properties window in AutoCAD.
  2. Use Quick Select or the QSELECT command to select objects by type (see Use Quick Select to select objects in your AutoCAD drawing).
  3. In the Properties window, find the values for Start Z, End Z, and Center Z (for certain shapes); change to any whole number other than 0 (zero) for each.
  4. Do the same except change the value of each to 0 (Zero). (This fixes any values that are more than eight decimal places and not visible in the Properties window). 
Note: To use this method with certain objects such as blocks and groups, they must first be exploded. Blocks may be exported to a new drawing through the WBLOCK command.

Alternative to change the Z value of objects to zero

Use the CHANGE command:

  1. Type in the CHANGE command.
  2. Type ALL to select all objects and then Enter.
  3. Type P for Properties.
  4. Type E for Elevation.
  5. Type 0 and then a final Enter to end the command.
Note: This will not work on complex objects such as 3D objects.

To flatten a drawing using LISPs, macros, and scripts

One or both of the following LISP routines, pasted into the command line in AutoCAD, will flatten a drawing.

  • This command changes the elevation of all objects to zero:
(command "_change""_all""""p""e""0""")
  • This command moves objects high and then back down to zero:
(command "_move""_all""""""0,0,1e99""_move""_all""""""0,0,-1e99")

Macros may be assigned to CUI buttons AutoCAD and AutoCAD LT.

  • To flatten selected objects:
^C^C_UCS;;_select;\_move;_p;;0,0,1e99;;_move;_p;;0,0,-1e99;;
  • To flatten the entire drawing:
^C^C_UCS;;_move;_all;;0,0,1e99;;_move;_all;;0,0,-1e99;;

How to use the SCRIPT (Command)

The ZIP file attached to this article is a script file that can be run in AutoCAD and AutoCAD LT. It will remove the elevation of all objects in the drawing.

  1. Start AutoCAD LT.
  2. Open any working drawing.
  3. At the Command prompt type Script.
  4. In the Select script file dialog browse to and select the saved script file.
  5. Select Open.
  6. The script will run through the commands.
  7. Save the drawing.

To flatten a drawing through PDF or DXB export

Do the following:

  1. Plot a PDF or DXB file.
  2. Import this file into a new or existing drawing with PDFIMPORT. The geometry will be flattened.
Notes:
  • To create a DXB file, a DXB PC3 printer must first be created using the Add-A-Plotter Wizard. Enter the PLOTTERMANAGER command to open the folder that contains the wizard.
  • AutoCAD 2017 and above have the PDFIMPORT command.
  • The DXB plotter converts all color data to black and white and places all drawing geometry on layer 0.
  • PDF files will retain color and layers as long as a color plot style and the PDF layers options is selected when creating the PDF.
 

Attachments:

Flatten.zip;

Products:

AutoCAD for Mac; AutoCAD LT for Mac; AutoCAD Products;


Was this information helpful?


Need help? Ask the Autodesk Assistant!

The Assistant can help you find answers or contact an agent.


What level of support do you have?

Different subscription plans provide distinct categories of support. Find out the level of support for your plan.

View levels of support