Advanced Method to Clean a Corrupted CAD File
CAD Tip 1033
In my last post, we discussed a basic cleaning procedures for a corrupted AutoCAD file. The same procedure is also a great way to check any incoming CAD file from the outside world to make sure that it is both “clean” and also as compact and efficient as possible for your use.
For a “basic” file checking and cleaning procedure, see my previous post, Tip 1032, “Cleaning a Corrupted AutoCAD Drawing.”
If you tried the basic cleaning procedure and you are still getting Audit errors or recurring items in the Purge list, go to the Advanced Super Cleaning Method below.
As we discussed in the previous post, it is not unusual to receive an AutoCAD drawing file from outside of your office that has corruption issues. This can happen, for example, when the drawing was created in a non-AutoCAD software environment. Many software packages claim to be AutoCAD-compatible, when in fact they have only limited ability to export an error-free DWG file.
Corruption can also occur when someone uses AutoCAD tools in non-standard ways, such as creating a text object with no text in it.
For whatever reason, sometimes you’ll run across a particularly stubborn glitch in a drawing file that resists the basic cleaning procedure in my previous post.
For this advanced cleaning method, I’m indebted to Robbie Kinch, one of the most skilled CAD artists I’ve had the pleasure of working with. The method is very powerful, yet fairly simple once you understand the steps.
The concept behind the Advanced Super Cleaning Method is that in some particularly stubborn drawing files, corruption can take the form of one or more objects that cannot be selected using a simple selection method such as a selection window, but can be selected using a Select All then DELETE method. To get rid of the hidden “bad” objects, you will do a Select All and then hit Delete. Whoa—you’re saying I should delete all the objects in my drawing? Yes . . . but first you protect the “good” objects inside of the Windows clipboard. Here’s the basic strategy:
- Select all “good” objects using a normal selection window
- Copy them to the Windows clipboard with the origin point (0,0,0) as the base pont
- Clean the file using [Ctrl]-A > Delete
- Purge and Audit as many times as needed
- Paste back the “good” objects and save the file.
Here are the detailed steps:
- Make a backup copy of your file, just to be on the safe side. Go to model space. Turn on and thaw all layers (see the previous post for shortcuts). Make sure all layers are unlocked.
- Zoom Extents by typing Z > [SPACEBAR] > E > [SPACEBAR]. Select every object in model space using a left-to-right selection window.
- Right-click with your mouse, and from the shortcut menu choose Clipboard > Copy with Base Point > 0,0,0 [ENTER]. Don’t rush this, since it may take several seconds or longer depending on the number and type of objects in the drawing. In the command line you will see something like “5023 found.” This lets you know that 5,023 “good” objects are now copied into the Windows Clipboard tool. You can feel confident moving on to the next step.
- Hit [ESCAPE] key twice, then hit [Ctrl]-A to select all objects in model space . . . including any “bad” objects. Now take a deep breath and hit the [DELETE] key. Watch the command line to see how many objects were deleted using this method. If the number is, say, one larger than the number of “good” objects copied to the Windows clipboard in Step 7, you have just exterminated one “rogue” troublemaker. Congratulations! Even if the numbers are the same, continue to the next step.
- Do a Purge procedure as described in the previous post, but this time choose Purge All button at the bottom of the Purge dialog box. Repeat Purge All if any items show up after the first Purge. Then run Audit, telling AutoCAD yes, you want to fix any errors detected. If any errors appear in the results from Audit, repeat Purge, then Audit again until you get zero errors.
- Paste back the “good” objects using [Ctrl]-V. Again, don’t rush this step. It may take several seconds or longer. When the command line asks you to Specify Insertion Point, type 0,0,0 [ENTER]. Wait patiently until all of the objects are pasted back to their original positions.
- Save the file, ideally to a new filename.
- Check for corruption once more using Purge, then Audit.
- Assuming the Audit procedure comes up with zero errors, you are good to go!
Hope this helps. Leave a comment below and share any cleaning methods you use.
Happy CADDing! 🙂
I also use -pu, enter, r, enter, enter, n, enter
It cleans all the registered applications not being used.
I have a drawing, that every time I audit it, it does nothing once it gets to pass 2. I did the above and it did the same thing on pass 2. There were a few “rogue” elements when I did the CTRL-A/DEL. But it still locks up on pass 2.
I have a question regarding cleaning files. Sometimes after finishing drawing or importing files or after flatshot I discover that there are lines above each other in the same layer. Is there a command that can clean the duplicated overlapping lines?
Al-Hasan, Thanks for the question. Yes, the command to use is OVERKILL. In the command line, type OVERKILL [ENTER]. Select the objects to be processed using a selection window, then hit [ENTER]. In the Delete Duplicate Objects dialog box, start by just keeping the default settings, which are OK for most situations. Hit the OK button, and you’re done! The command line dialog will tell you how many objects were deleted. Hope this helps! Mark
How can I get a custom text from another company out of the dwg. in purge box says it is items that can’t be purged.