alanjt 发表于 2016-11-30 12:06:52

...
What I don't understand is how your file is almost a mb smaller. What did you do to the drawing?
...
Just a quick wblock over itself without saving changes.. I do this to every file I get to get the 'crap' out.
How'd you wblock it out and keep all the contents in the sheet layout?

ronjonp 发表于 2016-11-30 13:11:14

...
What I don't understand is how your file is almost a mb smaller. What did you do to the drawing?
...
Just a quick wblock over itself without saving changes.. I do this to every file I get to get the 'crap' out.
How'd you wblock it out and keep all the contents in the sheet layout?
(defun c:purgeitfoo (/ c e)
;; Ronjonp quick purge 11.30.2016
;; Use at your own risk 8-)=
(if (and (= (getvar 'dwgtitled) 1) (/= (getvar 'writestat) 0))
    (progn (acad-push-dbmod)
         (setq e (getvar 'expert))
         (setq c (getvar 'cmdecho))
         (vla-save (vla-get-activedocument (vlax-get-acad-object)))
         (setvar 'expert 5)
         (setvar 'cmdecho 0)
         (setvar 'ctab "Model")
         (if (= 0 (getvar 'worlducs))
             (command "_.ucs" "_World")
         )
         (command "_.-wblock" (strcat (getvar 'dwgprefix) (getvar 'dwgname)) "*")
         (setvar 'expert e)
         (setvar 'cmdecho c)
         (acad-pop-dbmod)
         (if (= 0 (getvar 'cmdactive))
             (vl-cmdf "_.close" "_Yes")
         )
    )
    (alert "\nThis routine only works on drawings that have been saved or not readonly.")
)
(princ)
)

alanjt 发表于 2016-12-1 08:31:42

Cool! Thank you.
I didn't even realize wblock would do that.

alanjt 发表于 2016-12-1 11:57:19

Word to the wise: Set all viewports and all spaces (i.e. model-space, paper-space) to the World Coordinate System (WCS) before using the WBlock cleaning technique (or -ExportToAutoCAD) lest some drawings go wharrgarbl.
页: 1 [2]
查看完整版本: file bloat/infection