Optimizing the AutoCAD drawing file: Wblock Purge

Autodesk Support

Oct 8, 2023


Products and versions covered


Issue:

AutoCAD (.dwg) file corruption can be seen through one or more of the following symptoms:
  • File will open with errors.
  • File hangs or crashes AutoCAD.
  • Slow performance when editing and manipulating the file.
  • Error messages when working in the file.
  • Commands do not work or there is considerable delay in operation.
  • Unexplained file size increases.
  • Display/ Regen problems.
  • Drawing elements missing or shown incorrectly.

Causes:

File corruption can be introduced in numerous ways, some examples are listed below:
  • Third-party applications running inside AutoCAD.
  • DWG files created or saved by non-Autodesk or non-RealDWG products.
  • AutoCAD terminated while saving the drawing.
  • Old drawings used repeatedly over long time periods.
  • Network anomalies (transmission errors, file locking, latent writing of data).
  • Storage media degradation (bad sectors on a hard drive).

Solution:

Use the WBLOCK (Command) to save the contents of the drawing file to a user-specified location as a new drawing file. Wblock, also known as Write block, will only export the data which is in-use or referenced at the time. In other words, the objects exported are purged of all unnecessary data. 
  1. Ensure all layers are on, thawed, and unlocked.
  2. Detach all external references (xrefs). Double-check that the xrefs do not have circular attachments.
  3. Write Block all necessary information in the file out to a new drawing (from the command line):
    • Type WBLOCK at the command line.
    • Under Source, select Objects.
    • Under Objects, click the Select objects icon.
    • Use a selection window to choose only the necessary objects from the file (do not simply type ALL).
    • Set file path and name, then OK.
  4. Open a new blank drawing file.
  5. Insert the file created in Step 3 (from the command line):
    • Type INSERT at the command line.
    • Select the file.
    • Uncheck "Specify On-screen" and check "Explode", then OK.
  6. Type PURGE at the command line. With all checkboxes checked on, click Purge All.
  7. AUDIT and fix any errors.
  8. Type SAVEAS and create a new file name.

Products:

AutoCAD for Mac; AutoCAD LT for Mac; AutoCAD Products;


Was this information helpful?


Need help? Ask the Autodesk Assistant!

The Assistant can help you find answers or contact an agent.


What level of support do you have?

Different subscription plans provide distinct categories of support. Find out the level of support for your plan.

View levels of support