Tips & Tricks

FLATTEN: How to Fix 2D Drawings with Accidental Z Values

Fix apparently 2D geometry that sits at different Z elevations and causes problems with JOIN, TRIM, HATCH and other editing commands.

Level
Beginner
Best for
Imported DWGs and 2D drawings with unwanted elevation values
Commands
FLATTENPROPERTIESELEVATIONUCSPLAN

A drawing can look perfectly 2D from the Top view while some of its objects are actually sitting at different Z elevations. This often happens after importing consultant drawings, copying geometry between files or accidentally snapping to 3D objects. The result can be confusing: lines that appear to touch may not really intersect, polylines may refuse to join and other 2D editing commands may behave unexpectedly. In GstarCAD, FLATTEN is one of the quickest ways to return this geometry to a common plane.

What does accidental Z geometry mean?

Every CAD point can have X, Y and Z coordinates. In a normal 2D drawing, you usually expect the geometry to lie on the same XY plane, commonly with a Z value of 0.

Problems begin when apparently flat objects contain values such as:

Line 1: Z = 0
Line 2: Z = 0
Line 3: Z = 125
Polyline: Elevation = -20

From a Top view these objects may appear to overlap perfectly, but in 3D space they are actually separated vertically.

What problems can incorrect Z values cause?

Unexpected elevations can cause problems with many everyday operations.

  • lines that appear to intersect may not actually intersect,
  • JOIN may fail to create a continuous object,
  • trimming and extending can behave unexpectedly,
  • closed boundaries may be difficult to create,
  • hatching may fail or produce unexpected results,
  • geometry may behave strangely when exported to other applications.

This is why checking elevation is useful when a normal 2D command suddenly refuses to work even though the geometry looks correct.

How can you check whether an object has a Z value?

Select a suspicious object and open the Properties palette with Ctrl + 1.

Depending on the object type, inspect values such as:

  • Start Z,
  • End Z,
  • Position Z,
  • Elevation.

If a drawing is intended to be completely 2D but these values are not consistent, unwanted elevation may be the cause of the problem.

Change the view when in doubt

A Top view can hide elevation differences. Temporarily use a 3D or side view to inspect suspicious geometry and you may immediately see objects sitting above or below the expected plane.

What does FLATTEN do?

FLATTEN projects selected geometry onto a plane so that objects with different Z positions become planar. In a normal World Coordinate System and Top-view 2D workflow, this is commonly used to bring unwanted Z geometry back to the XY plane at Z=0.

The command can therefore be much faster than selecting hundreds of objects and manually changing their elevation properties one at a time.

  1. Save a backup of the drawing before making a large change.
  2. Make sure you are working in the intended coordinate system and view.
  3. Type FLATTEN and press Enter.
  4. Select the geometry that should become planar.
  5. Press Enter.
  6. Complete any additional prompts presented by the command.
  7. Inspect the resulting geometry.

After flattening, select several representative objects and verify their Z or Elevation values in Properties.

Do not flatten genuine 3D geometry accidentally

FLATTEN is intended to make geometry planar. If the drawing contains real 3D objects or intentional elevation information, flattening them can destroy information you wanted to keep. Select only the geometry that is supposed to be 2D.

Practical example: imported floor plan will not JOIN

Suppose you receive an architectural DWG from another consultant. The drawing looks completely flat and you want to combine several wall lines into continuous polylines.

However, some objects refuse to join even though their endpoints appear to touch.

You inspect the geometry and discover:

Wall line A: Start Z = 0, End Z = 0
Wall line B: Start Z = 15, End Z = 15
Wall line C: Start Z = -5, End Z = -5

From above, the endpoints appear coincident. In three-dimensional space, however, they are on different elevations.

  1. Keep a copy of the original consultant drawing.
  2. Select only the 2D plan geometry that should lie on one plane.
  3. Run FLATTEN.
  4. Check several objects again in Properties.
  5. Retry the required editing operation.
  6. Inspect intersections and boundaries before continuing with production work.

If the drawing came from converted PDF geometry rather than a native DWG, see our PDF to Editable DWG workflow for additional checks covering scale, fragmented geometry and drawing clean-up.

Can you simply change Elevation in Properties?

Yes, for simple cases. If a small number of objects all have a consistent elevation, selecting them and changing the relevant Z or Elevation property to 0 may be enough.

However, this becomes less practical when a drawing contains many object types or lines whose start and end points have different Z coordinates. FLATTEN is designed for situations where the geometry needs to be projected back into a planar drawing.

Why should you also check ELEVATION?

Cleaning the existing drawing does not help if new objects continue to be created at the wrong height.

The ELEVATION system variable controls the default elevation used when new geometry is created. For a conventional 2D drawing, check that this value has not accidentally been changed from 0.

This is particularly worth checking if new lines repeatedly appear with an unexpected Z coordinate even after the existing drawing has been cleaned.

What is the safest FLATTEN workflow?

Do not automatically flatten every object in every DWG. First confirm that the drawing is supposed to be 2D, identify the geometry with unwanted elevation and make a backup.

The practical workflow is:

CHECK PROPERTIES
↓
CONFIRM THE GEOMETRY SHOULD BE 2D
↓
BACK UP THE DRAWING
↓
FLATTEN
↓
CHECK Z VALUES AGAIN
↓
RETRY JOIN, HATCH OR OTHER 2D OPERATIONS

The productivity rule is simple: when 2D geometry looks correct but refuses to behave like 2D geometry, check the Z values. A few accidental elevations can create surprisingly confusing problems, and FLATTEN can often return the drawing to a clean planar state in one operation.

All tips Updated 3 November 2026
Continue learning
View all tips

Ready to switch to GstarCAD?

Get personalized advice on licensing, migration, and deployment for your business.

Contact us Buy now

No obligation — reply within 24h

Your Cart

Subtotal

Price does not include local taxes or duties.

Proceed to Checkout

Cookie preferences

Choose which cookies you want to allow. Essential and payment cookies cannot be disabled as they are required for the site to function.

Essential

Required

Core functionality including authentication, shopping cart, and language preferences.

Payment

Required

Required for processing payments securely through Stripe and PayPal.

Analytics

Help us understand how visitors interact with our site to improve the experience.

Marketing

Used to deliver relevant advertisements and measure campaign performance.

Functional

Order attribution and traffic source tracking to help us understand how customers find our store.