Author Topic: How to reduce the file size.  (Read 28982 times)

0 Members and 1 Guest are viewing this topic.

jitupnair

  • Guest
How to reduce the file size.
« on: June 27, 2012, 02:36:48 AM »
I have a drawing file with a single line (line copied from a huge file) . But the file size is 14.MB. I have noticed nearly 2173 line types in the file but none is used. Line type are still there after purging. While auditing it shows 464900 entities. Can someone help me to reduce the file size?.

If there is any nongraphical entities how to remove that ?. I cannot upload the file becouse of the

Thanks & Regards

Jithesh

MeasureUp

  • Bull Frog
  • Posts: 462
Re: How to reduce the file size.
« Reply #1 on: June 27, 2012, 02:54:13 AM »
[Joke]
Don't do too much at work.
[Serious]
Open the purge dialog by typing "purge" and  you'll see what you can do.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: How to reduce the file size.
« Reply #2 on: June 27, 2012, 03:01:36 AM »
Also try the command-line version by prefixing the purge command with a minus sign. Then purge RegApps, Empty Text & Zero Length objects. Then do a regular purge again (including blocks, layers, styles, ltypes, dimstyles, etc.) - do this at least 3 times as there may be nested stuff. Also check if there's a huge amount of layer-filters / and/or states.

Check if there's any blocks left in the drawing (use the Insert command). If there are, then they must be inserted somewhere on something like an Off/Frozen layer or on a different layout. Zoom Extents after turning on all layers on each layout to make sure there's not something hiding several miles off to a side.

If still there's a problem, start the MOVE command and then type ALL when asked to select objects. See what's displayed on the command-line.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Faster

  • Guest
Re: How to reduce the file size.
« Reply #3 on: June 27, 2012, 03:04:12 AM »
I have a drawing file with a single line (line copied from a huge file) . But the file size is 14.MB. I have noticed nearly 2173 line types in the file but none is used. Line type are still there after purging. While auditing it shows 464900 entities. Can someone help me to reduce the file size?.

If there is any nongraphical entities how to remove that ?. I cannot upload the file becouse of the

Thanks & Regards

Jithesh
Trying this code:
Code - Auto/Visual Lisp: [Select]
  1. (dictremove (namedobjdict) "ACAD_SCALELIST")

jitupnair

  • Guest
Re: How to reduce the file size.
« Reply #4 on: June 27, 2012, 03:33:05 AM »
I tried all the options in purge, audit, wblock, move etc still the file size is same. While moving its showing only one object, but in audit it shows 464900 objects.
 I cant remove 2173 line types loaded in the file using purge. I believe its from some nongraphical entities.

The file size is 13.5MB after compressing so I cant upload it.


Jithesh

HasanCAD

  • Swamp Rat
  • Posts: 1420
Re: How to reduce the file size.
« Reply #5 on: June 27, 2012, 03:38:48 AM »
first turn all layers on then Select all (using Cntrl+A) then check properties. I think that there are OLE objects.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: How to reduce the file size.
« Reply #6 on: June 27, 2012, 04:19:08 AM »
Trying this code:
Code - Auto/Visual Lisp: [Select]
  1. (dictremove (namedobjdict) "ACAD_SCALELIST")
That's extremely dangerous! If anything in that DWG file is annotative, then the DWG would crash ACad as soon as you select it. And I don't think it would make much difference in the filesize - not to the point of removing several MB.

Edit: On the same lines, there might be other dictionaries from stuff like AEC objects. To see what's going on there you could try my code from here: http://forums.augi.com/showthread.php?78139-remove-data-link-from-drawing&p=1145303&viewfull=1#post1145303

The file size is 13.5MB after compressing so I cant upload it.
What about using something like YouSendit / DropBox / 4Shared / etc. Then you could simply post a link to it here.

Something you could also try is saving it as an older version DWG to see if the anomalous objects either becomes visible / removed.
« Last Edit: June 27, 2012, 04:25:06 AM by irneb »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

pBe

  • Bull Frog
  • Posts: 402
Re: How to reduce the file size.
« Reply #7 on: June 27, 2012, 04:27:54 AM »
I have a drawing file with a single line (line copied from a huge file) . But the file size is 14.MB. I have noticed nearly 2173 line types in the file but none is used. Line type are still there after purging. While auditing it shows 464900 entities. Can someone help me to reduce the file size?.

If there is any nongraphical entities how to remove that ?. I cannot upload the file becouse of the

Thanks & Regards

Jithesh

Look into Annotaive Entities.  If a file has a large number of annotive scale AND  ALL scales on that list are assigned to each of the annotiative objects , the file will baloon 10 folds (exag  :-D)
 
EDIT: @ Irné
I encountered a file such as the one i described above. I actually used your OBJECTSCALECURONLY [Modified a bit] to "fix" the file, sure enough. 20MB ended up as 6MB.
« Last Edit: June 27, 2012, 06:41:49 AM by pBe »

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: How to reduce the file size.
« Reply #8 on: June 27, 2012, 05:51:03 AM »
Yep, size might increase drastically if multiple objects are attached to multiple scales. It's because each object would have a dictionary containing an XRecord to link it to each Scale (i.e. if there's 1000 objects and 100 scales there's 100000 XRecords). The best way to avoid this scenario happening is to never turn the AnnoAutoScale on - only turn it on when you really need it (like when creating a new viewport at a new scale), then immediately turn it off again! Otherwise it tends to attach all scales in the current drawing to all annotative objects in that drawing.

But what Faster's code does is simply delete the 100 scales themselves. The links would still be attached to the 1000 objects - i.e. there's still the 100000 XRecords. And these are what's going to crash acad, since if you select (or even hover the cursor over an entity) acad reads these XRecords attached to the object to find out if it needs to add the AnnoScale pop-up menu / that icon at the cursor. But seeing as they now point to something which doesn't exist acad crashes.

That ObjetcScaleCurOnly idea is a quick-fix. Just be warned it could still cause issues. Say you've got the same anno object displayed in 2 viewports at different scales. At least one of those viewports would no longer display that object after running my code. And you can imagine that this would cause lots of extra work if there's 100's of such objects and 10's of such viewports! A better solution would be to modify that code to a ObjectScaleUsedOnly version, but that is an extremely complex code to write since it would require some sort of "knowledge" as to which objects are displayed in all viewports (including viewports in DWGs which xref the current file into itself).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

jitupnair

  • Guest
Re: How to reduce the file size.
« Reply #9 on: June 27, 2012, 06:08:51 AM »
Thanks for the Idea Irneb,

I have uploaded the file to Dropbox.
Please follow the link

https://www.dropbox.com/sh/2q29z13b4v7fenq/j7PlrFcP7B/test-file-size.dwg

Thanks & Regards

Jithesh.

kruuger

  • Swamp Rat
  • Posts: 625
Re: How to reduce the file size.
« Reply #10 on: June 27, 2012, 06:26:57 AM »
Thanks for the Idea Irneb,

I have uploaded the file to Dropbox.
Please follow the link

https://www.dropbox.com/sh/2q29z13b4v7fenq/j7PlrFcP7B/test-file-size.dwg

Thanks & Regards

Jithesh.
huge number of linetypes. why they can't be deleted  :?
kruuger

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: How to reduce the file size.
« Reply #11 on: June 27, 2012, 06:30:22 AM »
Run this fantastic utility by MP and you will discover that the drawing contains 2,173 Linetypes and 4,539 Blocks (with names "*A####") indicating that these are no doubt used by the linetypes. The drawing also contains a dictionary: ACAD_DGNLINESTYLECOMP with 21,135 entries - this dictionary is probably preventing you from purging those blocks and linetypes.

kruuger

  • Swamp Rat
  • Posts: 625
Re: How to reduce the file size.
« Reply #12 on: June 27, 2012, 06:38:29 AM »
type this:
Code - Auto/Visual Lisp: [Select]
  1. (dictremove (namedobjdict) "ACAD_DGNLINESTYLECOMP")
then purge and dwg is clean.

thanks Lee for link. nice tool :)
kruuger

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: How to reduce the file size.
« Reply #13 on: June 27, 2012, 06:40:38 AM »
You're welcome Kruuger  :-)

I wonder what caused that dictionary and so many linetypes to be created in the first place?

Drawing size is reduced from 14.4MB to 55.1KB!  :-o

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: How to reduce the file size.
« Reply #14 on: June 27, 2012, 06:47:20 AM »
I wonder what caused that dictionary and so many linetypes to be created in the first place?
Well, from the dictionary name I'm guessing the DGN refers to a MicroStation file. Perhaps the drawing was originally imported from MS and this dictionary stayed inside even after everything was erased & purged.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.