[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Fully Purge Those Files
Tip# 3092 By Jon Jonas On 11-Jan-2009
4.5
Rated By 2 users
Categories : Purge
Software type : AutoCAD 2009
Rename File To : No Files to download.
When you do a Purge All at the command line, it does not really do a purge all. Here's a routine that does.

Jonathan Jonas sent us this tip about fully purging a file. Purge All doesn't purge all! It came to my attention this morning after dealing with screen glitches in AutoCAD 2008 and trying to figure out what might be causing them, that when you do a Purge All at the command line, it does not really do a purge all. Instead, it purges 11 of the 12 purgeable types of objects. What does not get purged are the Registered Applications that are embedded within a DWG file. For years now I've used the simple line below to do Purge All for all my drawings:

(Defun C:PUA () (Command "PURGE" "A" "*" "N"))

However, now that I know this doesn't work, I've adjusted the simple code to force AutoCAD to truly purge everything with the following changes to the code:

(Defun C:PUA () (Command "PURGE" "A" "*" "N")(command "purge" "r" "*" "n"))

I would suggest that others who also have their own versions of a Purge All command take a second look at theirs to be sure they have them modified to encompass the full purge command.

Notes from Cadalyst Tip Patrol: I didn't believe this tip at first, but it is true; sorry for my lack of faith. Purge All does not purge Registered Applications or Xdata. These can bog down a file. They get there from inserting or referencing other files that have these applications in them. If you don't have a custom purge button, routine, etc., then the only way to get to this option is by typing in –purge on the command line. You need the hyphen so that the dialog box won't open and it is a text-only interface. Type in R for Registered Applications, and so on. Running the purge command this way can help clean up a file. If you have a custom button for the purge command using Diesel (in a toolbar, ribbon, or pull down menu) here is the code to run the above tip:

^C^C-purge;A;*;N;-purge;R;*;N;

This routine was tested in AutoCAD 2009.
 

 

 

Average Rating:
4.5


User comments
Comment by Anonymous
Posted on 2009-01-14 11:17:04
"Fully Purge Those Files" I programmed a button with the code provided, when I purged a large drawing I opened the text window using "F2" and scanned the results, I noticed that the defpoints layer got purged. Is that ok? Let me know before I use this command again. Thanks, Bill Karkula
Comment by Somppi,Robert
Posted on 2009-01-14 18:57:05
"I noticed that the defpoints layer got purged. Is that ok? Let me know before I use this command again. Thanks, Bill Karkula" Yes. I regularly purge that layer using AutoCAD's "Purge" command. If "Defpoints" is needed again, it will be added "automagicly".