Jump to content

The size of a file is too large


ehsantavassolian

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Have you tried to use "_.-PURGE" in command line with option "_Reg" ?

And repeat with option "_all"

Edited by Tsuky
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

@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")

 

image.png.b6f4dd949b107d92847ffd7d7c808a56.png

Edited by ronjonp
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Sometimes that is the best solution, start again. New file, all the left overs are gone, pretty much fail safe

Link to comment
Share on other sites

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)
)

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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")

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...