Author Topic: Dwg file sizes??  (Read 6995 times)

0 Members and 1 Guest are viewing this topic.

whdjr

  • Guest
Dwg file sizes??
« on: February 14, 2008, 01:24:39 PM »
I have a dwg file with 27 layout tabs.  It has approx. 100 xrefs scattered between the tabs.  The file is approx. 7mb.  I split the file into 2 dwgs, 1 with 15 tabs and 1 with 12 tabs.  The 15 tabbed dwg is still approx 7mb and the 12 tabbed dwg is approx. 3mb.  Any ideas why this would be?  I purged both dwgs after I split them.

Josh Nieman

  • Guest
Re: Dwg file sizes??
« Reply #1 on: February 14, 2008, 02:36:18 PM »
Just thinking off the top of my head... most of that data causing an increase in TOTAL data size is probably stuff like block definitions and such, where it has to be duplicated in both drawings...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Dwg file sizes??
« Reply #2 on: February 14, 2008, 02:38:43 PM »
Guessing dictionary pollution by the usual suspects. Try this, share the report if you wish.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: Dwg file sizes??
« Reply #3 on: February 15, 2008, 10:24:16 AM »
Alright I managed to get your code to write me a report so they are attached.

0-A2X-sheets.dwg  = 7,390mb
0-A2-15 - A2-29.dwg is the 1st half of 0-A2X   = 3,397mb
0-A2-30 - A2-42.dwg is the 2nd half of 0-A2X  = 7,171mb


The blocks count on some of these items doesn't add up.  For instance our title block is "r-tb30x42".  This is one layout tab one time.  We also have an xref "r-tb30x42-info" that is on every tab one.  There should be the same amount of both of these but they are drastically different.

I don't mind posting the dwgs however there MANY xrefs in these dwgs.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Dwg file sizes??
« Reply #4 on: February 15, 2008, 10:35:04 AM »
The block.counts are the number of entities hosted by each block. That is, If block A is comprised of 5 lines and 5 attributes the count is 10 even if there are 100 instances of same.

That said, try running this (will take awhile) --

Code: [Select]
(progn

    (defun _AnalyzeThis ( this / _IndexThisEx _IndexThis _Main )
   
        (defun _IndexThisEx ( this / objectname pair )
   
            ;;  index is a lexical global declared in _Main
   
            (setq index
                (if
                    (setq pair
                        (assoc
                            (setq objectname
                                (vlax-get this 'Objectname)
                            )
                            index
                        )
                    )
                    (subst
                        (list
                            (car pair)
                            (1+ (cadr pair))
                        )
                        pair
                        index
                    )
                    (cons
                        (list objectname 1)
                        index
                    )
                )
            )
           
            ;;  not strictly needed but
            ;;  return the index to the caller           
   
        )
   
        (defun _IndexThis ( this )
       
            ;;  _IndexThis is a wrapper for IndexEx.
            ;;  don't get it? Too bad, so sad.
           
            (_IndexThisEx this)
           
            ;;  this is not a robust example of programming,
            ;;  but in the interests of time and ascii economy
            ;;  I'm using a simplistic recursive sledge hammer
            ;;  technique
           
            (vl-catch-all-apply   
           
               '(lambda ( )
               
                    ;;  force an error if the 'this'
                    ;;  object is not a collection
               
                    (vlax-get this 'Count)
               
                    ;;  let 'em know we haven't died
               
                    (princ
                        (strcat
                            "Indexing "
                            (vl-prin1-to-string this)
                            "                             "
                            "                             "
                            "                             "
                            "\r"
                        )
                    )
               
                    ;;  'kay, let's roll
               
                    (vlax-for object this
                        (_IndexThis object)                   
                    )
                )
            )           
        )
   
        (defun _Main ( this / index )
       
            ;;  variable 'index' is a lexical global accessed
            ;;  by lexical global function _IndexEx.
       
            (_IndexThis (vlax-get this 'Blocks))
            ;;(_IndexThis (vlax-get this 'ModelSpace))
           
            (princ "\nOrdered by object type:\n")
           
            (mapcar 'print       
                (vl-sort
                    index
                   '(lambda ( a b ) (< (car a) (car b)))
                )
            )                 
   
            (princ "\n\nOrdered by object count (descending):\n")
           
            (mapcar 'print       
                (vl-sort
                    index
                   '(lambda ( a b ) (> (cadr a) (cadr b)))
                )
            )                 
   
            (princ "\n\nTotal object count: ")
           
            (princ (apply '+ (mapcar 'cadr index)))
           
            (princ)       
       
        )
   
        (_Main this)
   
    )
   
    (defun C:AnalyzeThis ( )
   
        (_AnalyzeThis (vla-get-activedocument (vlax-get-acad-object)))
       
        (princ)
   
    )
   
    (c:AnalyzeThis)
   
)
« Last Edit: February 15, 2008, 11:03:29 AM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: Dwg file sizes??
« Reply #5 on: February 15, 2008, 10:49:43 AM »
...after about 1 second.


Code: [Select]
Indexing #<VLA-OBJECT IAcadModelSpace3 14384294>

Ordered by object type:

("AcDbBlockReference" 3)
("AcDbBlockTableRecord" 1)

Ordered by object count (descending):

("AcDbBlockReference" 3)
("AcDbBlockTableRecord" 1)

Total object count: 4

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Dwg file sizes??
« Reply #6 on: February 15, 2008, 10:54:42 AM »
Try it again, I revised these lines in that code snip --

(_IndexThis (vlax-get this 'Blocks))
;;(_IndexThis (vlax-get this 'ModelSpace))
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: Dwg file sizes??
« Reply #7 on: February 15, 2008, 11:00:35 AM »
There were too many lines for AutoCAD to show them all and I didn't think you really wanted that info anyway.  If you do I will need to output it to a text file for you.

Quote
......
Indexing #<VLA-OBJECT IAcadBlock3 1e08e134>
Indexing #<VLA-OBJECT IAcadBlock3 1dfb83a4>
Indexing #<VLA-OBJECT IAcadBlock3 1dfc3544>
Indexing #<VLA-OBJECT IAcadBlock3 1e0235f4>
Indexing #<VLA-OBJECT IAcadBlock3 1e027864>
Indexing #<VLA-OBJECT IAcadBlock3 1e007624>
Indexing #<VLA-OBJECT IAcadBlock3 1e066a94>
Indexing #<VLA-OBJECT IAcadBlock3 1e0635c4>
Indexing #<VLA-OBJECT IAcadBlock3 1e063db4>
Indexing #<VLA-OBJECT IAcadBlock3 1e090d94>
Indexing #<VLA-OBJECT IAcadBlock3 1e093a84>
Indexing #<VLA-OBJECT IAcadBlock3 1e097f74>
Indexing #<VLA-OBJECT IAcadBlock3 1e097c64>
Indexing #<VLA-OBJECT IAcadBlock3 1e097794>
Indexing #<VLA-OBJECT IAcadBlock3 1c20bdf4>
Indexing #<VLA-OBJECT IAcadBlock3 1e0a0a84>
Indexing #<VLA-OBJECT IAcadBlock3 1e0a4774>
Indexing #<VLA-OBJECT IAcadBlock3 1e082334>
Indexing #<VLA-OBJECT IAcadBlock3 1e08c774>
Indexing #<VLA-OBJECT IAcadBlock3 1e09cb74>
Indexing #<VLA-OBJECT IAcadBlock3 1e098764>
Indexing #<VLA-OBJECT IAcadBlock3 1e099c14>

Ordered by object type:

("AcDb2LineAngularDimension" 26)
("AcDb2dPolyline" 284)
("AcDbAlignedDimension" 102)
("AcDbArc" 62788)
("AcDbArcDimension" 45)
("AcDbAttributeDefinition" 7048)
("AcDbBlockReference" 33174)
("AcDbBlockTable" 1)
("AcDbBlockTableRecord" 13301)
("AcDbCircle" 17719)
("AcDbEllipse" 692)
("AcDbFace" 57)
("AcDbHatch" 1245)
("AcDbLeader" 1515)
("AcDbLine" 277118)
("AcDbMText" 12181)
("AcDbPoint" 27062)
("AcDbPolyline" 77196)
("AcDbRadialDimension" 14)
("AcDbRasterImage" 1)
("AcDbRotatedDimension" 8789)
("AcDbSolid" 85)
("AcDbSpline" 67)
("AcDbText" 2216)
("AcDbViewport" 92)

Ordered by object count (descending):

("AcDbLine" 277118)
("AcDbPolyline" 77196)
("AcDbArc" 62788)
("AcDbBlockReference" 33174)
("AcDbPoint" 27062)
("AcDbCircle" 17719)
("AcDbBlockTableRecord" 13301)
("AcDbMText" 12181)
("AcDbRotatedDimension" 8789)
("AcDbAttributeDefinition" 7048)
("AcDbText" 2216)
("AcDbLeader" 1515)
("AcDbHatch" 1245)
("AcDbEllipse" 692)
("AcDb2dPolyline" 284)
("AcDbAlignedDimension" 102)
("AcDbViewport" 92)
("AcDbSolid" 85)
("AcDbSpline" 67)
("AcDbFace" 57)
("AcDbArcDimension" 45)
("AcDb2LineAngularDimension" 26)
("AcDbRadialDimension" 14)
("AcDbRasterImage" 1)
("AcDbBlockTable" 1)

Total object count: 542818

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Dwg file sizes??
« Reply #8 on: February 15, 2008, 11:04:55 AM »
Revise again to distill the "in process" feedback, try again.

The telling bit imo is this -- ("AcDbBlockReference" 33174) -- does that seem reasonable to you?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: Dwg file sizes??
« Reply #9 on: February 15, 2008, 11:15:45 AM »
Are those blocks or xrefs?  Does it count nested blocks?

The dwg has 27 layout tabs and about 100 xrefs.  Does that indicate the amount you mentioned?

Quote
Ordered by object type:

("AcDb2LineAngularDimension" 26)
("AcDb2dPolyline" 284)
("AcDbAlignedDimension" 102)
("AcDbArc" 62788)
("AcDbArcDimension" 45)
("AcDbAttributeDefinition" 7048)
("AcDbBlockReference" 33174)
("AcDbBlockTable" 1)
("AcDbBlockTableRecord" 13301)
("AcDbCircle" 17719)
("AcDbEllipse" 692)
("AcDbFace" 57)
("AcDbHatch" 1245)
("AcDbLeader" 1515)
("AcDbLine" 277118)
("AcDbMText" 12181)
("AcDbPoint" 27062)
("AcDbPolyline" 77196)
("AcDbRadialDimension" 14)
("AcDbRasterImage" 1)
("AcDbRotatedDimension" 8789)
("AcDbSolid" 85)
("AcDbSpline" 67)
("AcDbText" 2216)
("AcDbViewport" 92)

Ordered by object count (descending):

("AcDbLine" 277118)
("AcDbPolyline" 77196)
("AcDbArc" 62788)
("AcDbBlockReference" 33174)
("AcDbPoint" 27062)
("AcDbCircle" 17719)
("AcDbBlockTableRecord" 13301)
("AcDbMText" 12181)
("AcDbRotatedDimension" 8789)
("AcDbAttributeDefinition" 7048)
("AcDbText" 2216)
("AcDbLeader" 1515)
("AcDbHatch" 1245)
("AcDbEllipse" 692)
("AcDb2dPolyline" 284)
("AcDbAlignedDimension" 102)
("AcDbViewport" 92)
("AcDbSolid" 85)
("AcDbSpline" 67)
("AcDbFace" 57)
("AcDbArcDimension" 45)
("AcDb2LineAngularDimension" 26)
("AcDbRadialDimension" 14)
("AcDbRasterImage" 1)
("AcDbBlockTable" 1)

Total object count: 542818

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Dwg file sizes??
« Reply #10 on: February 15, 2008, 11:18:53 AM »
BlockReferences are blocks that are inserted into the drawing, and xrefs are just blocks linked to another drawing, so yes xrefs would be counted as BlockReferences.  You also have 13000+ blocks defined in the drawing (BlockTableRecord).
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Dwg file sizes??
« Reply #11 on: February 15, 2008, 11:20:48 AM »
Are those blocks or xrefs?

Current incarnation does not differentiate; so AcDbBlockReference can be an instance of a block or an xref.

Does it count nested blocks?

Yes.

The dwg has 27 layout tabs and about 100 xrefs.  Does that indicate the amount you mentioned?

Yes?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: Dwg file sizes??
« Reply #12 on: February 15, 2008, 11:31:29 AM »
The dwg has 27 layout tabs and about 100 xrefs.  Does that indicate the amount you mentioned?

Yes?

What I meant was the amount of blocks you questioned.

whdjr

  • Guest
Re: Dwg file sizes??
« Reply #13 on: February 15, 2008, 11:33:12 AM »
BlockReferences are blocks that are inserted into the drawing, and xrefs are just blocks linked to another drawing, so yes xrefs would be counted as BlockReferences.  You also have 13000+ blocks defined in the drawing (BlockTableRecord).

That is why I asked if it picked up nested blocks, like in xrefs?  If I type in 'insert' it only lists about 30 blocks.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Dwg file sizes??
« Reply #14 on: February 15, 2008, 11:39:50 AM »
BlockReferences are blocks that are inserted into the drawing, and xrefs are just blocks linked to another drawing, so yes xrefs would be counted as BlockReferences.  You also have 13000+ blocks defined in the drawing (BlockTableRecord).

That is why I asked if it picked up nested blocks, like in xrefs?  If I type in 'insert' it only lists about 30 blocks.
For the block table record count I'm sure it does.  Just like it would find xref'ed in style names, layers and dimensions.  Acad probably programs into the core the ability to block out names that have the pipe character "|" that signifies and xref'ed dependent object.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.