CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 78
Plex.Earth connects AutoCAD and Google Earth

CAD tip CAD tip # 9553:

   
Question CAD 
 %  platform  category 
Q - question

Complete thorough PURGE on a single click.

A - answer Most AutoCAD users probably know the command PURGE for removing unused definitions of blocks, styles, lineptypes, dimension styles, etc. from a DWG file.

If you need to automate purging in your drawings, you can use a simple menu macro (to assign to a button click in your ribbon) or a script. For this, you will use the commandline version of the Purge command, i.e. -PURGE. Remember that not all tables and objects are purged with the option "All", so you will need to separately invoke purging of some special objects (registered applications, zero-length geometry, empty texts). Another special type of object are the DGN linetype definitions - there is a special DGN-hotfix for them (see Download) with the command DGNPURGE. Due to possible nested objects, it is advisable to repeat the purging process a couple of times.

Then the resulting script for purging really all excessive unused objects and definitions from the current DWG drawing looks like this:

  
_NETLOAD DGNLSPURGE.DLL  
DGNPURGE  
_-PURGE _REGAPP * _N  
_-PURGE _ZERO  
_-PURGE _EMPTY  
_-PURGE _ALL * _N  
DGNPURGE  
_-PURGE _ALL * _N  
DGNPURGE  
_-PURGE _ALL * _N  

Except DGNPURGE, you can perform this purging also in AutoCAD LT. You can also use this script to batch-purge drawings with ScriptPro.

UPDATE: Since version 2015 you can use _-PURGE _Orphaned instead of loading and calling DGNPURGE.

Please note that all these purge commands can be executed - e.g. with a .SCR script - also in the console (non-graphical) version of AutoCAD, AcCoreConsole.exe. See the Tip 8552.

ACADLTADTACADMCivilMapPlant
100% *  CAD 
19.11.2013    36653×  

See also:
Tip 13675:Two PURGE commands in Autodesk Civil 3D.
Tip 12933:Purging small objects from a DWG drawing - PurgeSmall.
Tip 12592:How to automatically purge old backup files .BAK?
Tip 12198:How to remove duplicate points and COGO points from a DWG?
Tip 11439:Replace block instances (incl. dynamic) with another block.


Back   All CAD Tips



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Extend your AutoCAD LT productivity with our popular add-on
CADstudio LT Extension More info


Please use these tips at your own risk.
Arkance Systems is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist