How to repair AutoCAD file and fix its errors
This article will help you repair AutoCAD file that is corrupted to an extent that it does not even open or if it opens, it either makes your system very slow or crashes it completely.
Also, if your AutoCAD drawing file size has increased unexpectedly or you are constantly getting error messages like “drawing file is not valid” then you can use the methods mentioned in this article to fix the errors.
So, let’s start with the most serious problem which is the file not opening at all.
AutoCAD file does not open:
You can try the following methods to open the file that is not opening normally or not opening at all.
Recover Command
Open a new blank drawing and type RECOVER on the command line and press enter key.
A new “browse” window will open up, locate your file which is not opening and click the Open button.
AutoCAD will perform an audit and the file should now open in the current window, save it as a new DWG file.
Insert file as a block
If the above method does not work then try inserting the corrupted AutoCAD file as a block.
Type INSERT on the command line, press enter, and the Blocks palette will show up.
Click the “Libraries” tab and then click the file navigation icon as shown in the following image.
Locate the corrupted AutoCAD drawing that is not opening and then click the Open button.
If the file opens up in the blocks palette simply drag and drop it from the “libraries” tab to the current drawing.
Clean the AutoCAD drawing you just added and then save it as a new file.
Insert the file as Xref
If none of the methods above worked then try inserting the drawing as an Xref.
Type ATTACH and press enter key, from the browse window that shows up.
Select the DWG file in the file type option and then locate your corrupted AutoCAD file and click the Open button.
Select the default option in the “Attach External Reference” window and click OK.
The drawing should attach as an Xref in the current blank drawing.
Type XREF and then select the attached Xref from the palette, then right-click on it and select the bind option as shown in the following image.
After binding the drawing explode it all using the X command and then save it as a new file.
Remove DWL files
AutoCAD creates some temporary files that are required to work with your drawing and if the software crashes unexpectedly these files are removed which can create problems.
These files are DWL and DWL2 files and they are created in the same folder as your main drawing.
So you can delete these temporary files that might still be present in your folder containing the corrupt file.
To delete these files close AutoCAD completely then go to windows explorer and activate the hidden file view as shown in the following image.
Now go to the folder containing the corrupted AutoCAD drawing and delete the DWL and DWL2 files with the same name.
As an example here my corrupted drawing is named FP but I have FP.dwl and Fp.dwl2 files that I will delete.
Now try opening the files again and see if it works.
Recover using backup files
AutoCAD creates two types of backup files. One is the BAK file which is the simple backup created in the same folder as the main file and it contains the last saved configuration of your drawing.
The second one is the backup created automatically as per AutoCAD’s automatic backup setting which is usually set to 10 minutes and this file is in the temporary folder and its file type is SV$.
If you happen to have a BAK file with the same name as the corrupted file then try renaming the BAK file to DWG.
As an example, if the file name is FP.bak then rename it to FP-1.dwg and then open the file and see if it works.
To restore the backup from the temporary folder type OP then press enter key.
Now go to the files tab and click the + sign next to the “Automatic save file location” and then go to the location shown in the file path.
Locate the file with the same name as your corrupted file with SV$ extension and then rename that file DWG as shown in the previous example of the BAK file.
Try opening this recovered file and see if it works.
Use other software
If AutoCAD is not able to open the file then try opening it in other AutoCAD verticals like AutoCAD electrical, mechanical, architecture or even other software like Fusion 360 or Solidworks that supports DWG files.
You can also try software that is similar to AutoCAD like BricsCAD and Zwcad to open these files.
If the files open in any software then save them as a new DXF or DWG and then try opening these files again in AutoCAD.
AutoCAD file opens with errors
If your drawing is opening but still showing errors then you can fix those errors using the suggestions mentioned here.
Perform AUDIT
This command will check for simple errors in the AutoCAD file and it will attempt to fix those errors.
To use this command type AUDIT on the command line and press enter, then select Yes from the command line options or type Yes and press enter.
AutoCAD will automatically look for errors in the file and it will fix those errors.
The number of errors found and repaired will show up on the command line as shown in the image below.
If you want to see the list of errors repaired as an external file then change the value of the AUDITCTL system variable to 1.
An ADT file will be created in the same location where the AutoCAD file is saved and you can open this file using notepad to see the list of all errors.
Use EXPORTTOAUTOCAD
Many DWG files created with other products like Civil 3D and other software contain intelligent AEC objects that are not directly translated to AutoCAD and eventually will show errors when opened in AutoCAD.
Also, some plugins and third-party tools can create smart objects that can down the road create issues in the drawing if not converted properly.
So, using the EXPORTTOAUTOCAD command you can convert all these AEC and other objects into simple AutoCAD format.
To use this tool type -EXPORTTOAUTOCAD (don’t forget to add the dash) and press enter key.
Now press the enter key twice and the file will be exported to the same location as the source file with the ACAD prefix.
Clean your drawing with PURGE
The purge command is now supercharged with several new features that were available in stand-alone plugins.
Essentially you can clean your drawings thoroughly using the purge command from version 2021 onwards.
Type PURGE and press enter key then select all the checkboxes in the “options” panel including “Zero length geometry” and “Orphaned data” and click the “Purge All” button.
Orphaned data includes the “DGN linetypes” which usually bloats up the drawing, so, selecting that option will automatically ensure that DGN linetypes are also purged from your drawing.
You may need to click the Purge All button a few times, as long as it is active, to clean your drawing completely.
Save it as a new file and you should be good to go.
Clean Registered Applications (REGAPPS)
AutoCAD associates extended entity data XData to different objects in the drawing and this data is stored in the XData table.
When the associated data is deleted these linked tables become unreferenced that still remain in the drawing which can negatively impact the performance over time.
To remove the Reg Apps type -PURGE and press enter key (don’t forget to add the dash before the purge command).
Now select Regapps from the command line and press enter key.
On the next prompt “Verify each name to be prompted” select No and press enter and it will clean all the Regapps from your drawings.
Use Write Block
You can use the write block command to export the necessary parts from the drawing leaving all the clutter behind that might be creating the issues.
To use it type WBLOCK and press enter key.
In the “Source” panel of the “Write Block” window select “objects” and then click on the pick point box and select any point in the drawing as a pick point.
Then click the “Select objects” box and select all the objects from the drawing you want to export by making a window selection.
Don’t press CTRL + A to select everything in the drawing instead only select the objects that you want to export manually.
Now in the destination select a path and then click OK to export this drawing.
This should create a new file with only the objects that you need leaving behind all the clutter that might be creating the problem in your drawing.
Try these options too
If all the above methods fail to fix the issue with your drawing then you can try the following options.
Make sure the file is on a local drive
If you are accessing your file directly from a network or a cloud drive then copy and paste it on your local drive preferably on C drive like Desktop or Documents folder and then try opening it again.
Also, make sure you are opening a file after unzipping it, so, if you’ve received a file in the zipped package then unzip it in a folder and then try opening that file.
You can also try moving your file to a different PC and try opening it there, make sure in a new PC you copy your file to a local drive like on the Desktop and then open it.
If the problem is in your PC or the installed software then it should work on a different PC.
Try the Drawing repair AutoCAD plugin
Install the Repair plugin from the Autodesk app store and run it on your drawing and see if it works.
Make sure you save the file as a new one so that you can compare it with the original one also it’s better to create a backup rather than overwriting the original file.
Conclusion
All the methods shown above are the steps that you can take to restore a drawing file properly but some files might be irreversibly damaged and for those files, none of the methods shown above will work.
If however, your drawing file is showing an error that is not due to data corruption then you can try AutoCAD’s common troubleshooting tips.
Also, you should ensure that your PC has antivirus software as drawings do get corrupted because of viruses.
So, did these tips fix your problem? let me know in the comments down below.
I drawn autocad drawings in AutoCAD 2022. But when I want to open those files which aren’t opend. Will you give me the information what should I do…
The best part of using CMS IntelliCAD was finding out it has all the CAD features Iโd already worked with. I was pretty worried about finding a good fit for me, but CMS IntelliCAD is definitely unbeatable. Registered for free and had a free trial before payment, I’m glad I could test it out before any payment. CMS IntelliCAD is definitely worth the hype.
Hello Pandey, Great stuff.
I am looking for that kind of stuff and you write superb. I love to read this fully article. thanks for share this wonderful information with us.
Hello Jaiprakash
When I open (lets say) 10 drawings do my work and save it again then always there is a case that one or two files get corrupt I recover those by using backup files or recover option.
but I need to send those files to my senior collegues after work is done then they also used to complain the same problem
every time the files which were done by me only gets corrupt
from last 3-4 months I m facing the problem again and again
Is there any fix need to done in autocad or there is a problem in my pc?
please help!!
I am looking or searching for that information for a long time so thanks for sharing this meaningful information with us.
Moving .dwg files from version 2016 to 2020. W hen files are saved in 2020 the errors show up as missing line work and text.
Running Audit and recover in 2016 shows no errors
Great post, I am looking for that kind of stuff and you write superb. I love to read this fully article. thanks for share this wonderful information with us.
Hi Jai, Delete the image from the drawing and re-embed the JPEG images in AutoCAD. But this time first ensure they are opening properly in any image editor without any distortion. If not, repair your corrupt or distorted JPEG/JPG files using Stellar Repair for Photo Software, then add to the drawing. It is a repair tool that fixes all kinds of corruptions in JPEG photos including grainy, blurry, broken, or pixelated and fixes issues like corrupt headers, JPEG file data, invalid JPEG file structure, etc.
hi.
I am an Interior designer.
We face the problem when on of our system infected by virus “LALO”.
All of our data corrupted. All CAD files.
We are not even convert our BAK files into DWGs.
error shows ” DRAWING FILE IS NOT VALID”
Please give us solution.
Hello jaiprakash,
Thanks for sharing with us.
I am searching that kind of stuff for my project and learned a lot of new things from your blog, so thanks again.
Wonderful, I learned a lot of new things and It worked. thanks for sharing this wonderful information with us..
Hi, Mr. Jaiprakash,
We have one autocad user and he left the company but before that he Shift+Deleted the autocad file. I have recovered the file via some recovery software now all the file shows Drawing files is not valid. Even .Bak file also we tried to rename to .dwg and its shows the same. Is there any tool/software you can suggest to repair these files also we have tried to use recover command for these file but no luck. Appreciate your response on this.
Regards
Nawaz
Hi, Nawaz.
I am afraid if recover command did not work for the files that simply mean your files are corrupted beyond repair. There are some DWG repair tools available online but they are mostly paid ones and I have never tried them so can’t vouch for them either, but maybe you can try them once as a last option.
Sir, can you please help me restore the autocad classic in autocad 2015? thank oyu Sir
i have a different kind of problem here, when i draw a line in autocad 2019, i give a particular dimension to it but when i try to check it again it gives me a value of 102938456.23(a random large value).
its the same with every drawing, i tried to repair and reinstall too, nothing worked so far.
any ideas of wht could have possibly gone wrong.
i am a bit new to autocad hope you could be helpful
Thanks sir Pandey! You saved my life and my job hahaha. Great advice from you.
I have searched anywhere for an answer and here you are. Im really glad to read your article.
Typing “Recover” at the command did it.
Thank you very much sir Pandey!
God Bless!! :D
Hello sir i am having very strange problems. I was working on autocad and when i open the file that file showing error that the drawing file is not valid and i try to use .bak file but that also doesn’t open after rename with .dwg file. I also tried the recovery file but that also doesn’t opne. During that time i opened 3-4 file and that all doesn’t open and few are deleted automatically. Please help what to do?
Hello sir I have recover my acad file
Hi Jai
my cad file of 4.3 mb was not opening when i run recovery it worked but size reduced to some 350kb and some contents are also missing. However i restored the bak file and converted to dwg which is of 4.3 mb but whenver trying to open it asks to recover and comes with the same missing contents and about 450kb..
Plz help.
There is very little that can be done because the drawing is completely corrupt as you mentioned. I guess you have to make missing components again :(
I just found this article and did the RECOVER and It worked.
THANK YOU
Welcome Albert!
Hi
My autocad files got deleted. Then I recovered using recovery software. After recovery when I open the file it is showing Drawing file not valid. What can I do ?
The recovery software’s are not always able to recover files completely so you may find them as corrupted files after recovery. My best advice is to recover backup file (assuming its not deleted).
I CAN NOT THANK YOU ENOUGH FOR THIS INFORMATION!!!! My computer was acting up so I saved the drawing and restart. my drawing said error and had few doors and 3 walls left. I lost 60 hours of work!!! I just found this article and did the RECOVER and It worked!!!!!! I can stop panicking now and reach my dead line today!
THANK YOU!!!!!
I am glad this tip saved lots of hours of your work
Hi Jaiprakash,
I am actually facing issue while opening file and getting error message file “Drawing file is not valid”.
This problem i am facing to attack my system with the virus (norvas).
All my file extensions change with the ending of .norvas. What i did is to scan my system with the antivirus and change the extension manually.
Please guide how can i fix this bug.
while working all all he drawing disappear although the cad file still have its volume
can you share the screenshot as it’s very difficult to find the reason with this info.
working on a 2d file and a 3d file (different name & location). Autocad crash. After restarts auto cad there was same 3d contents in both 2d & 3d file. how is it possible. there was no sv$ file. cad crash on 2:03 pm. i was try to recover the drawing from the .bak file which was last save on 1:06 pm. but the content showin same in .bak file. what is the reason. now i have to re-draw the drawings again.
It seems like your AutoCAD Autosave time is extended or disabled. Unfortunately if drawing is not recovered using all of the methods mentioned above then you need to re-create it. But you can ensure that it keeps on saving file in future for that Save this lisp file in C:Program FilesAutodeskAutoCAD 201xSupport where 201X is the version of your AutoCAD. download file from this link https://www.dropbox.com/s/dnvvvqgt89bwo55/user%20commnet.zip?dl=1
Sometimes Autosave is disable automatically due to some scripts running in background but it fails to start again so to ensure it starts every time you start your AutoCAD application you can save the script as mentioned above, this lisp will ensure that every time AutoCAD starts it will load that file which tells AutoCAD to make an Autosave every 15 minutes.