• Home
  • Training Books
  • Subscribe to Our Email Newsletter
  • About
    • Contributors
    • Feedback
    • Contact
    • Privacy policy
    • Cookie Policy

CADnotes

CAD Tutorials and Best Practices for professionals and students

  • Featured
  • AutoCAD
    • AutoLISP
  • Revit
    • Revit Architecture Basic
    • Revit MEP Basic Tutorial
  • Inventor
  • MicroStation
    • MicroStation Basic Tutorial
You are here: Home / AutoCAD / How to: Fix Drawing That’s Accidentally Has Z value

How to: Fix Drawing That’s Accidentally Has Z value

December 27, 2016 by Edwin Prakoso 4 Comments

In this Article...

  • Using AutoLISP program
  • Manually Fix the Drawing
  • Preventing this Issue

This is a classic issue with AutoCAD drawing: Sometimes you accidentally draw with elevation in your 2D drawing. The probable cause is because you snap to an existing object with elevation. But we never know, why the objects have Z value in the first place anyway.

If you rotate the drawing and see it from an elevation view, you will see the objects has elevations. This is a 2D drawing, so it’s not supposed to look like this.

There is a suggestion to use FLATTEN command to fix it. But it never works well for this issue.

Before you continue, create a backup of your drawing!

Using AutoLISP program

My recommended tool for this problem is by using ALLFLAT by Lee Mac. You can find the code in CADtutor forum here. If you are not familiar with using AutoLISP program,

If you are not familiar with using AutoLISP program, read how you can save the code and use it here. Lee Mac has many useful LISP program. This program is very simple and works very quickly.

However, because this program is very simple and not developed further, there are some minor issues with rotated blocks and hatches. If you want to try another solution, try SUPERFLATTEN by Joe Burke. The problem with SUPERFLATTEN is it doesn’t work with dimensions and OLE object.

Dimensions are a bit tricky because they don’t have elevation. If you use Associative Dimension, then you will be okay. The dimension will follow the objects. The problem is when the dimension is not associated with any object.

You may want to try them both and see which one works well for you.

Manually Fix the Drawing

If you use AutoCAD LT or AutoLISP doesn’t work for your drawing, you can try to fix it manually. It’s not difficult but takes some time.

Select all objects. Or you can select only objects that have elevations from elevation view. For a very complex drawing, you may want to do this gradually. Selecting all objects at once can make your computer slow or crash.

We need to change the Z value for our objects to 0 (zero). Open Properties Palette.

Because we select multiple types of objects, we will not see the Z or elevation properties here.

Click the object drop-down list. Select an object type, except for dimensions and hatches. We can ignore them because they don’t have elevation.

The elevation field is named differently. For example, blocks elevation is defined by Position Z. Change the Position Z value to 0.

Repeat the procedure for other object types.

Here are several fields that control the elevation.

  1. Lines elevation are defined by Start Z and End Z
  2. Polylines elevation are defined by Elevation
  3. Arc, Circle, and Ellipse elevation are defined by Center Z
  4. etc.

The real challenge is when you have blocks with the objects inside it have different Z value. You will need to open each block in block editor and change the Z value using the procedure above.

I know this can be a tedious task. But if you need to continue working on this drawing, I suggest you fix it. The problem won’t just go away; it would be harder to work with it when it gets more complicated!

Preventing this Issue

If you only with 2D drawing, it is a good idea to set Object Snap to ignore Z value. It will not fix existing drawing, but at least you will not having a bigger problem.

You can set it in AutoCAD options, Drafting Tab. Check Replace Z value with current elevation.

If you prefer to change System Variable from the command line, it is saved in OSNAPZ variable.

It’s a good idea to add this variable in System Variable Monitor, so when the variable changed you will know it immediately. Yes, sometimes the variables are changed in a mysterious way.

If you are adventurous, you can add the default System Variable in acad.lsp or acaddoc.lsp. It will make sure the variable is set when you start AutoCAD.

About Edwin Prakoso

I work as a Sr. Consultant in PT Cipta Satria Informatika. I've been using AutoCAD since R14 and Revit since Revit Building 9. I occasionally write for AUGIWorld magazine and I am also active in Autodesk discussion forum. I'm a member of Autodesk Expert Elite, an appreciation for individuals who give contributions to the Autodesk community.
Connect with me on twitter or LinkedIn.

Filed Under: AutoCAD Tagged With: autocad tips

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

4 Comments
Inline Feedbacks
View all comments
Wesley
Wesley
4 years ago

Hi, I think you made an interesting point here, thanks for writing this idea it was very helpful for those of us who are planning to do outsourcing. Please visit https://cadsourcing.com/ for more information.

0
Reply
ThiganS
ThiganS
5 years ago

Great. It helps me a lot .Thank for sharing this tip. I prefer the manual way than others. Because it looks so easy to do.

0
Reply
Kameron Coryell
Kameron Coryell
5 years ago

Hello, I currently have AutoCAD LT 2018 and keep having the issue where when I place a line, it places it also in the Z-axis. I tried checking the box that is labeled “Replace Z Value with current elevation” but I do not have that box/ option at all. Any help would be great thanks. – Kameron

6
Reply
Ella
Ella
Reply to  Kameron Coryell
3 years ago

Hi, I am having the same problem. Did you find a solution? Thanks

1
Reply
wpdiscuz   wpDiscuz

Featured

What’s New in AutoCAD 2021?

Autodesk released AutoCAD 2021. What’s new? Is there something that you expected? Find out here.

Recent Articles

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available

Advertisement

New on CADnotes

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available
  • Autodesk Forma Design Contest
  • Revit 2025: Toposolid Enhancements

Meet the Authors

avatar for
avatar for
avatar for
avatar for
avatar for
avatar for

Get Connected

CADnotes on FacebookCADnotes on InstagramCADnotes on TwitterCADnotes on YouTube

© 2009 – 2025 CADnotes · Feedback · Privacy Policy · Become an affiliate

wpDiscuz