Purge

Keeping your drawings clean and tidy doesn’t just make them more visually appealing, it can also keep the file size smaller and help you avoid mistakes.

AutoCAD has cleanup tools such as PURGE and OVERKILL that remove unused or duplicate items from a drawing and help keep your drawing file clean from clutter.

What is Purge?

Purge removes unused items or named objects, such as block definitions and layers, from the drawing.

Purge is the term used to describe removing a definition of a non-graphical object rather than erasing a graphical object. For example, you might erase all the graphical objects in your drawing that use a dashed linetype, but that still leaves the linetype definition in the drawing. Similarly, erasing all block references of a fixture still leaves the block definition for that fixture block in the drawing.

Purging Unused Items

Let’s try purging unused items. You may already have a drawing with purgeable items, but if not, you can easily create some unused layers.

  1. Click Home tab > Layers panel > Layer Properties.  
  2. In the Layer Properties manager, click New Layer several times to create a few new layers. Since these layers don’t have any objects on them, they are unused and can be purged.

Note: You can also create unused block definitions by inserting blocks into the drawing and then deleting them.

Options

Purge Nested Items

Removes unused named objects from the drawing even if they are contained within or referenced by other unused named objects.

Purge Unnamed Objects

  • Zero-length geometry. Deletes geometry of zero length, including lines, arcs, circles, and polylines.
  • Empty text objects. Deletes text objects that are blank or contain only spaces without any text.
  • Orphaned data. Performs a drawing scan and removes obsolete DGN linestyle data when you open the Purge dialog box.

Note: The PURGE command won’t remove unnamed objects from blocks or locked layers.

What is Overkill?

When drafting in AutoCAD, it’s quite easy to inadvertently create overlapping, duplicate objects in your drawing. These duplicate objects aren’t just visually unappealing. They can increase file size, cause trouble when trying to select or modify objects, or might cause errors when exporting a drawing. Overlapping lines can even cause manufacturing machines to create improper cuts.

OVERKILL removes duplicate or overlapping lines, arcs, and polylines, and also combines those that are partially overlapping or contiguous.

The following changes can be made to geometric objects in a drawing:

  • Duplicate copies of objects are deleted
  • Arcs drawn over portions of circles are deleted
  • Lines at the same angle that partially overlap are combined into a single line
  • Duplicate line or arc segments are deleted
  • Overlapping and zero-length polyline segments are deleted
Read more

To delete unused blocks from a CAD drawing, you can use the “PURGE” command in AutoCAD.

Here’s how to do it:

  1. Open your CAD drawing in AutoCAD.
  2. Type “PURGE” in the command line and press Enter. This will open the Purge dialog.
  3. In the Purge dialog, you’ll see a list of all the types of objects that can be purged. Look for “Blocks” in the list.
  4. Click on “Blocks” to select it.
  5. Now, you’ll see a list of all the blocks in your drawing. Blocks that are in use (inserted in the drawing) will have a little lightning bolt icon next to them, indicating that they are in use.
  6. Blocks that are not in use will not have this icon. To remove unused blocks, select the blocks you want to delete by clicking on them.
  7. Once you’ve selected the unused blocks, click the “Purge” button at the bottom of the dialog. This will remove the selected blocks from your drawing.
  8. AutoCAD will ask if you are sure you want to purge these items. Confirm by clicking “Yes.”
  9. After the purge is complete, the unused blocks will be removed from your drawing, reducing its file size.
  10. Save your drawing to ensure that the changes are preserved.

It’s important to exercise caution when using the PURGE command, as it permanently deletes objects from your drawing. Make sure you’ve identified and selected only the unused blocks you want to delete.

Read more

In some circumstances, the size of drawing files can become larger than expected. The following list provides you with common possibilities.

  • Many incremental saves (refer to the ISAVEPERCENT system variable)
  • Large hatches, especially if they have been exploded
  • Large 3D meshes
  • Unused DGN line styles or other orphaned data
  • A large number of proxy objects
  • A large number of block definitions or a few large-sized block definitions
  • A large number of scales defined for layout viewports, page layouts, and plotting (refer to the SCALELISTEDIT command)
  • A large number of layer filters (refer to the FILTERS command)
  • A large number of registered applications

The PURGE or -PURGE commands will fix most of these problems. Additional steps you can take include the following:

  • Use the AUDIT command to remove any corrupt objects
  • Use the WBLOCK command, selecting all objects, and save them as a new drawing file
  • Save the drawing in DXF format (ASCII option) for further investigation using a text editor (advanced)

A good practice is to create several smaller drawings. Use the XREF command to merge them into a master drawing, and then do your work in the smaller drawings.

Here are several methods you can use to compress DWG files:

Purge Unused Data

  1. Open your DWG file in AutoCAD.
  2. Use the “PURGE” command. This will remove unused layers, blocks, linetypes, and other elements from the drawing.
  3. You can also use “AUDIT” to fix errors in the drawing. This can sometimes reduce file size.

WBlock

Selecting all objects, and save them as a new drawing file.

Save as DXF (Advanced)

Save the drawing in DXF format (ASCII option) for further investigation using a text editor

Bind External References

If your DWG file references other DWG files (Xrefs), consider binding them. This will incorporate the Xref data into the main DWG, reducing external dependencies and file size.

Export to an Earlier DWG Version

Use the “SAVEAS” command in AutoCAD to save the drawing as an earlier DWG version. Newer versions may have added data or features that increase file size.

Third-Party Software

There are third-party software applications designed for compressing DWG files. They often have more advanced features for optimizing file size.

ZIP or Archive Files

You can compress one or more DWG files into a ZIP or other archive format. While this doesn’t directly compress the DWG, it can significantly reduce the size of the archive, making it easier to store and share multiple drawings.

Remember to keep backups of your original files before performing any compression operations, as some changes may be irreversible. Additionally, the effectiveness of compression can vary based on the content and complexity of the drawing.

Read more