Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reducing drawing size

15 REPLIES 15
Reply
Message 1 of 16
rubintabraham
1102 Views, 15 Replies

Reducing drawing size

 

 

     I am worling with cleaning up Autocad drawing inorder to reduce the file size. Since there  are enormous number of layers i want it to be reduced to a single layer. My work plan is to convert the entities control not by layers but specifically by line size and colors . Is there an easy way or a macro to convert the  entities control independent of layer so that i can purge the entire file to a single layer

15 REPLIES 15
Message 2 of 16

Easy way to get to the same Layer would be CHPROP;ALL;;LAyer;0;; (untested)

Colors and thickness could be guided thru QSELECT unless you do not already have that established then this part would be one by one. 

Message 3 of 16
dmfrazier
in reply to: rubintabraham


@rubintabraham wrote:

 

 

     ... in order to reduce the file size. Since there  are enormous number of layers i want it to be reduced to a single layer.  ...purge the entire file to a single layer


Moving everything to a single layer and then purging all the other layers probably will not reduce the size of the file significantly.

Also, by placing everything on one layer, you lose the facility to freeze, thaw, lock, noplot, isolate, etc. based on layer.  (You may have a plan to replace these facilities with some other comparable functionality, but why go to the effort when it's already built in?)

 

In any case, if you really want to do this, maybe this thread has what you need:

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/change-layer-of-object-to-color-not-b...

 

(I found this by using the terms "change bylayer to color LISP" in the DG search field.)

Message 4 of 16

Thanks for the quick reply. But still i need to work more on it. For instance, if i am having 1000 files and about 50 layers in each drawing i need to manually control the line thickness , style, color and other variables which gonna be really tedious. I am trying to reduce this working time .

Message 5 of 16
dmfrazier
in reply to: rubintabraham

I am finding it difficult to follow what you are trying to accomplish here.

 

In your first post, it seemed that your goal was to "reduce the file size".

Now you say:


@rubintabraham wrote:

...I need to manually control the line thickness, style, color, and other variables which gonna be really tedious. I am trying to reduce this working time .


Why do you feel that you need to do these things?  I think we can offer better help if you provide more detail.

If you want to "control not by layers but specifically by line size and colors", you can still do this without moving everything to one layer.  If you are referring to plotted output, see the Help topics on Plot Style Tables.

Message 6 of 16
rubintabraham
in reply to: dmfrazier

My primary aim is to reduce the file size and i am trying to accomplish it by certain ways. After file clean up, i am having about 50 layers with various entities. I found that i can reduce the file size to 1/3rd of original size if i am able to reduce the layer to a single one i.e; default layer. Since the entities in different layers are having unique line style, thickness and colors  it will take the default layer properties if i move them to default layer. I donot want this to happen. If it is done manually it gonna consume much time .

   

    In a nutshell , i want drawing with a single layer and entities with  different line style, thickness and color.

Message 7 of 16
dmfrazier
in reply to: rubintabraham

Thanks for clarifying.


@rubintabraham wrote:

I found that i can reduce the file size to 1/3rd of original size if i am able to reduce the layer to a single one i.e; default layer.


That is quite surprising!  A lot of things affect file size, but it's hard to believe that just removing layers could reduce the file size by 67%!

I don't mean to be argumentative, but I just tested this on a random file that had 187 layers.  The original file size was 5.05MB.  I used CHPROP to move everything to layer 0, which allowed me to purge 150 of the layers.  (There were block inserts and definitions preventing me from purging all of them.)  After saving the file, the size actually increased to 5.14MB!  Maybe the results would be more positive on small drawings with practically no objects?

 

Anyway, I'm sure I've seen references to AutoLISP utilities that will assist you in converting objects from BYLAYER to specific colors or linetypes or lineweight based on the color, linetype, or lineweight of the layer.  There might even be one that works on the block definitions in the dwg.  When I have a little more time, I'll see if I can find any of those (assuming someone else doesn't chime in in the meantime).

Message 8 of 16
rubintabraham
in reply to: dmfrazier

Thanks for quick reply and pls get back if u find good thread to control layers.

Message 9 of 16

You are going to comsume much time.

I would explore QSELECT and the exclusions/incusions you can do thru that Dialog.

There are options to append current selection sets with other qualifiers that may get you to the place you need by selecting multiple objects as once.

As far as moving these items to one Layer and retaining the current Lineweight and Color if these are already Bylayer for Color and Lineweight simply moving them to another Layer will take on that Layers Properties for Color and lineweight.

If these entities have overrides for Color and Lineweight then those will be maintained and only the Layer name will change.

 

What else is on your drawing aside from simple Layers and entities?

Many Layouts? Titleblocks Duplicated? Dynamic Blocks? Hatching? Custom Hatches? Lots of text?

Message 10 of 16
dmfrazier
in reply to: rubintabraham

Here is a thread you can take a look at:

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Change-objects-color-to-that-of-the-l...

The code posted by MelFranks (test3) may work for one step of your process.

Message 11 of 16
nestly2
in reply to: rubintabraham

Is it possible the file size is not bloated due to many Layers, rather excessive Layer Filters?

Message 12 of 16

The thread looks good but still i am looking it to be elaborative, since i want to control the color, linetype and line thickness.

Message 13 of 16
jggerth1
in reply to: rubintabraham

since this is the 'drafting techniques' forum, please excuse me while I go off on a rant.....

 

Controlling object display on a per-entity basis, that is assigning a color, lineweight, linetype, etc to each and every object in a drawing, is IMHO one of the worst possible things you could do.  It's even worse if you collapse all of the layering structure into a single layer.  It becomes impractical/impossible to repurpose the drawing or to xref the drawing, to reuse or recycle the design in any meaningfull way.

 

The drawing is instantly non-portable, and will be a horrendous bear to work with both now, and down the road when that job comes back to life, or if the information in the drawing needs to be reused for a Phase 2, or addenda, really for any other purpose other than the original.  No-one works in a vacuum - every one dealing with CAD is involved at some level of collaboration with other users, and no drawing is ever guaranteed to be never needed again.

 

If the goal is to waste time and money, while concurrently making the design information useless, then the approach of collapsing layers and  doing by-entity control of object properties is an excellent technique and a great way to sabotage the end product.

 

it's not however, a 'drafting technique'.

Message 14 of 16
nestly2
in reply to: jggerth1

+1 on the hazards of removing layering. 

IMO, the layers themselves are not causing the drawing to be 200% larger than than it would be with a single layer.  Isolate the cause, rather than destroying the drawing.

Message 15 of 16
dgorsman
in reply to: nestly2

WAG: extra layers from annotative objects via the SAVEFIDELITY setting, along with lack of annotation scale control.  Extra layers, extra objects, bigger file.

 

Overall, yes - fix the actual problem.  Its like putting a bucket under a roof leak.  The problem isn't that the bucket keeps overflowing, its that the roof is leaking.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 16 of 16
Bob_Zurunkle
in reply to: dgorsman

OP you never did say what sort of CAD files these are or what business you are in -- civil? architectural? structural? mep? machine design? what?

 

Is someone else requiring you to reduce file sizes? or have you decided on your own? Are there others that also access your work and use it too?

 

If I were you I'd explore other options before taking the radical step of putting it all on one layer. These are people here with lots of collective experience trying to tell you "Don't do that!" and for good reasons.

 

If you use Recover to open a drawing file, and then purge it and save it, you should notice some improvement. There is a command line -purge that has more options to purge, such as regapps.

 

In addition you can write the entire file off as a new block (a separate drawing). That will get rid of a lot of extra stuff too.

 

Do you use XREFs? If not, then explore what they are and how to use them. There are settings that only read the portion of the XREF necessary to the drawing it is XREF'd into.

 

There are lots of other suggestions if you search this site for them. But for heaven's sake don't put all on one layer. That's a Freshman error that's right up there with moving things with some layers turned off!

If by some odd chance my nattering was useful -- that's great, glad to help. But if it actually solved your issue, then please mark my solution as accepted 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost