ehsantavassolian Posted February 23 Posted February 23 Hello This file contains one text and one line The size of this file is more than 4 megabytes. But it is logical that the size of the file should be less than 100 kilobytes I also used the purge and audit commands, but the problem was not solved My problem is that if I copy any object from this file, other files will find the same problem. Where is this amount of information in this file? And how to solve this problem? Thank you very much for spending time on this topic size problem.dwg Quote
eldon Posted February 23 Posted February 23 Have you tried to Wblock the useful information to give a fresh drawing? This usually leaves behind all sorts of hidden and not needed information. Although my version of AutoCAD is ancient, I downloaded your drawing and converted it to my version, when the size increased to 22 megabytes! An interesting command is STATUS which shows that the original drawing has 142933 objects. It also has 8974 unnamed blocks besides many linetypes, etc.. When I WBLOCK this drawing with a window to choose the line and text only, the file size decreases to 73 KB. Quote
Tsuky Posted February 23 Posted February 23 (edited) Have you tried to use "_.-PURGE" in command line with option "_Reg" ? And repeat with option "_all" Edited February 23 by Tsuky Quote
SLW210 Posted February 23 Posted February 23 I have moved your thread to the AutoCAD General Forum since it has nothing to do with LISP. Wblock worked here as well. 15kb size problem-Wblock.dwg 1 Quote
Steven P Posted February 23 Posted February 23 Purge, Audit, Overkill, purge and purge again solves a lot. If you are left with layers, try laydel to manually delete what you don't want. Should also delete objects on the layer. There are LISPs that do the same to delete blocks - I think Lee Mac has one on his website (there are others). Not sure if these will all delete unnamed blocks Then purge again and again (I have a LISP, 'purgea' that does purge - all 3 times) After that remake the file. For 2 items can just select and copy individually. Otherwise select top left to bottom right. Copy to new file or wblock. Open the files... and purge again just to be sure. Quote
SLW210 Posted February 23 Posted February 23 It got larger when I ran -Purge on it. There is somewhere out there one or more LISPs that basically will Wblock the drawing, might be useful for running a batch on a folder. Quote
1958 Posted February 23 Posted February 23 (edited) size problem_.dwg Edited February 23 by 1958 Quote
ronjonp Posted February 23 Posted February 23 (edited) @ehsantavassolian This is probably the bulk of the bloat: ACAD_DGNLINESTYLECOMP.Count = 78790 This will allow all the anonymous blocks to be purged .. and the file size for me after removing those is 21 KB. (dictremove (namedobjdict) "ACAD_DGNLINESTYLECOMP") Edited February 23 by ronjonp Quote
ehsantavassolian Posted February 23 Author Posted February 23 9 hours ago, SLW210 said: I have moved your thread to the AutoCAD General Forum since it has nothing to do with LISP. Wblock worked here as well. 15kb size problem-Wblock.dwg 14.53 kB · 0 downloads This has been the best solution so far Thank you very much for finding the solution But with this method, a new file is created, and the damaged file is not corrected Quote
Steven P Posted February 23 Posted February 23 Sometimes that is the best solution, start again. New file, all the left overs are gone, pretty much fail safe Quote
SLW210 Posted February 23 Posted February 23 Save it with the same name and same location and it should overwrite the old file. Quote
ronjonp Posted February 23 Posted February 23 25 minutes ago, ehsantavassolian said: But with this method, a new file is created, and the damaged file is not corrected Try using this modified version of some super old code. I cleanup drawings with this daily. (defun c:endit (/ adoc c e file s) (if (and (= 1 (getvar 'dwgtitled)) (getvar 'writestat)) (progn (acad-push-dbmod) (setq e (getvar 'expert) c (getvar 'cmdecho) file (strcat (getvar 'dwgprefix) (getvar 'dwgname)) adoc (vla-get-activedocument (vlax-get-acad-object)) ) (dictremove (namedobjdict) "ACAD_DGNLINESTYLECOMP") (repeat 3 (setq s (ssget "_X" '((0 . "AEC*,*PROXY*")))) (progn (setvar 'qaflags 1) (vl-catch-all-apply 'vl-cmdf (list "_.explode" s "")) (setvar 'qaflags 0) ) ) (vla-save adoc) (setvar 'expert 5) (setvar 'cmdecho 0) (setvar 'tilemode 1) (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) ) 1 1 Quote
ehsantavassolian Posted February 23 Author Posted February 23 50 minutes ago, SLW210 said: Save it with the same name and same location and it should overwrite the old file. (COMMAND "-WBLOCK" (STRCAT (getvar "DWGPREFIX") (getvar "DWGNAME")) "Y" "*" "quit" "n") Quote
ehsantavassolian Posted February 23 Author Posted February 23 38 minutes ago, ronjonp said: Try using this modified version of some super old code. I cleanup drawings with this daily. (defun c:endit (/ adoc c e file s) (if (and (= 1 (getvar 'dwgtitled)) (getvar 'writestat)) (progn (acad-push-dbmod) (setq e (getvar 'expert) c (getvar 'cmdecho) file (strcat (getvar 'dwgprefix) (getvar 'dwgname)) adoc (vla-get-activedocument (vlax-get-acad-object)) ) (dictremove (namedobjdict) "ACAD_DGNLINESTYLECOMP") (repeat 3 (setq s (ssget "_X" '((0 . "AEC*,*PROXY*")))) (progn (setvar 'qaflags 1) (vl-catch-all-apply 'vl-cmdf (list "_.explode" s "")) (setvar 'qaflags 0) ) ) (vla-save adoc) (setvar 'expert 5) (setvar 'cmdecho 0) (setvar 'tilemode 1) (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) ) wow.... that was perfect I'm surprised Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.