Removes unused named references such as unused blocks or layers from the document.
Supported platforms: Windows only
No return value.
This method is the equivalent of entering purge at the Command prompt, selecting the All option, and then choosing Yes to the "Purge Everything?" prompt.
Deleted objects remain in the document until they are purged using this method.
VBA:
Sub Example_PurgeAll() ' This example removes all unused named references from the database ThisDrawing.PurgeAll End Sub
Visual LISP:
(vl-load-com) (defun c:Example_PurgeAll() ;; This example removes all unused named references from the database (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (vla-PurgeAll doc) )