Monday, October 17, 2011


I know I said I wasn't going to write any more AutoCAD-related articles, but this was sparked by a recent client visit, so I felt it was worth revisiting.  I've mentioned the AutoCAD PURGE command before, but it needs to be revisited.

Something that is very unique to the world of CAD is the extent to which content is reused.  More than any other class of application:  word processing, spreadsheets, databases, desktop publishing, even more than photographic and illustration applications.  CAD shops around the world routinely insert library content from years of accumulated work.  Everything from the smallest items to sheet borders, to complex 3D components and entire compound assemblies.  Content is king, and CAD content is the king of kings.

But there's a problem.  Along with the visual attributes there is an entire world of non-visual baggage that comes along with every reused chunk of content.  Layers, dimension styles, text styles, linetypes, shapes, extended data (xdata) and xrecords, are just a typical brush stroke of examples of things that often sneak in with each library part insertion.

But wait: There's more!

Along with the legacy visual, and sinister non-visual stuff, there's the often overlooked issue of inconsistent and inaccurate data structures.  I'm talking about the DWG format itself.  With each release of AutoCAD, for example (I'm sure this is applicable to other CAD products), there are improvements to the methods and processes for detecting errors in the data format and correcting them.  Some of the tools in AutoCAD that help with this are AUDIT and RECOVER.  There's also WBLOCK and DXFOUT, and other methods/tricks, but you get the idea.  The problem is that rarely do CAD managers or anyone else take the time to comb back through years of old DWG files to run these tools and clean them up.

Most often what happens is we get into a habit of inserting content, exploding it, erasing what we don't need, then running PURGE and saving.  At least run AUDIT when you do that.  If you don't, you risk corrupting the new drawing, or at the very least you'll bloat it to death.  File size is not something to ignore.  The bigger the file, the slower it copies and the slower it gets backed up.  It also takes longer to open and longer to save, especially across a network connection.

AUDIT (fix errors)
PURGE (nested)
PURGE (nested) again
AUDIT (fix errors) again
SAVEAS (new dwg file) replace the old dwg file

I haven't bothered to search, but I'm sure there are at least a few products available for helping to batch process drawing files for you.  Even if you can't afford to purchase one, you could build something using LISP, VSA, ObjectARX, VBscript, Javascript, KiXtart, PowerShell, or just two sticks and a bucket of mud.  Whatever the case, don't ignore this.  Just because you ran AUDIT and PURGE on those old drawings back when you used AutoCAD R14 or 2000, doesn't mean they can't still contain errors and junk that AutoCAD 2012 would find and correct.
Post a Comment