Discus84 Posted December 17 Posted December 17 Hi, I'm using PURGE and OVERKILL to clean up. Any other options? Quote
ReMark Posted December 17 Posted December 17 One I can think of is to WBLOCK the entire drawing out to a new file name (temporarily) then compare the file sizes. 1 Quote
CyberAngel Posted December 17 Posted December 17 The worst waste of storage I've seen is inserting another drawing as a block (either as copy&paste or xref), using it for whatever, then freezing the layer it's on. Sometimes they'll insert it once, forget it's there, and explode the second copy, so it's there twice. Or three times or more. The usual tools don't work on these duplicates. There are ways to find them, but most are clunky. For instance, thaw all the layers. See if anything looks suspicious. Select areas of the screen to see if there are outrageous numbers of objects. Another strategy is to look through your blocks. One may have an odd name or a thumbnail that looks like a plan. Look through your layers for groups that don't belong. Go through your layouts. Needless to say, don't save the drawing while you're tracking down the problem. Once you do find it, quit the file, reload it, fix it, and then save. Quote
SLW210 Posted December 17 Posted December 17 Are you using AutoCAD 2010? Along with previous suggestions and to add, you can do a lot of cleaning with the WBLOCK @ReMark, best method for true cleaning is to WBLOCK just the selected/visible objects you need, that way some of the things mentioned by @CyberAngel are hopefully not carried to the new drawing. I always start with -EXPORTTOAUTOCAD to clean up objects left by verticals, etc. 1 Quote
BIGAL Posted December 18 Posted December 18 Using a CIV3D dwg a lot of info is not purged as its locked by CIV3D, need to use PURGESYLEANDSETTINGS before Purge. The dwg will drop in size quickly. Quote
SLW210 Posted December 18 Posted December 18 11 hours ago, BIGAL said: Using a CIV3D dwg a lot of info is not purged as its locked by CIV3D, need to use PURGESYLEANDSETTINGS before Purge. The dwg will drop in size quickly. That is only available in Civil 3D AFAIK, not much use for someone with AutoCAD 2010. Quote
CyberAngel Posted December 18 Posted December 18 1 hour ago, SLW210 said: That is only available in Civil 3D AFAIK, not much use for someone with AutoCAD 2010. But just in case you are using Civil, try to prune out as many points as you can. They take up approximately 1K apiece. One thousand points = 1MB of space. It adds up. Quote
SLW210 Posted December 19 Posted December 19 There are some free and paid apps in the Autodesk Appstore that really do a super job. Not sure if they work on AutoCAD 2010 though and OP refuses to respond to my question on what CAD they use. Quote
BIGAL Posted December 19 Posted December 19 I have seen a dwg with a complete project inside the current dwg which had nothing to do with the dwg being worked on. Look for $AC.... blocks these can be very extensive in size. You need to insert explode erase then can purge. Do you get a blank screen with Zoom Extents ? This is indicating that something is way out there normally in a corner and can be a complete dwg. The only real way to fix is to look at the dwg, understand company copy right problem but you can PM or email via a PM to people here who will look at the dwg and let you know what they find. Quote
Steven P Posted 2 hours ago Posted 2 hours ago A couple of LISPs, PurgeZeroLengths and PurgeZeroTexts: Note that purgezerolengths has a 'less than a length' for very short lines, here set at 0.01 - comment that out with ;; at the beginning of the line if not needed. These remove orphaned lines and texts. Copy and paste to a new drawing (top left -> bottom right seletion) or wblock does a lot. If not needed delete points - don't show up on the printed page, and if not needed get rid. Bit more effort but using blocks for repeated objects can remove some bloating. If you don't need them to be polylines, explode 2 vertex polylines into lines (2nd LISP box below). Explode heavy polylines into LW polylines of you can, both smaller file sizes One I have tucked away, join perpendicular lines back together - example convert from PDF, dashes are individual lines, this will go some way to recreating them as lines - run after 2 vertex poly to line (3rd LISP box, not perfect, only does H or V lines) (defun c:PurgeZeroLengths ( / MySS DelSS MyEnt EndA EndB) ;; for within blocks (setq MySS (ssget (list (cons 0 "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE")))) (setq acount 0) (setq DelSS (ssadd)) (while (< acount (sslength MySS)) (setq MyEnt (ssname MySS acount)) (if (equal (vlax-curve-getDistAtParam MyEnt (vlax-curve-getEndParam MyEnt)) 0) (progn (setq DelSS (ssadd MyEnt DelSS)) ) ) ; end if ;;If less then a length (if (< (vlax-curve-getDistAtParam MyEnt (vlax-curve-getEndParam MyEnt)) 0.01) (progn (setq DelSS (ssadd MyEnt DelSS)) ) ) ; end if (setq acount (+ acount 1)) ) ; end while (princ "\nDeleting ")(princ (sslength DelSS))(princ " lines") (command "erase" DelSS "") (princ) ) (defun c:PurgeZeroTexts ( / MySS DelSS MyEnt MyText) ;; for within blocks (setq MySS (ssget (list (cons 0 "*TEXT")(cons 1 "")))) (setq acount 0) (setq DelSS (ssadd)) (if MySS (progn (while (< acount (sslength MySS)) (setq MyEnt (ssname MySS acount)) (setq MyText (cdr (assoc 1 (entget MyEnt)))) (if (equal MyText "") (progn (setq DelSS (ssadd MyEnt DelSS)) ) ) ; end if (setq acount (+ acount 1)) ) ; end while (princ "\nDeleting ")(princ (sslength DelSS))(princ " lines") (command "erase" DelSS "") ) ; end progn (progn (princ "No zero content texts found") ) ) ; end if (princ) ) (defun c:pdfDashed2PL ( / MyEnt MySS EndA EndB LEndA LEndB Orientation acount EndPoints LineLengths) ;; Selects by layer and colour (defun LoadLineType (doc LineTypeName FileName) ;;https://www.cadtutor.net/forum/topic/76557-load-linetypes-from-lisphelp/ (if (and (not (existLinetype doc LineTypeName)) (vl-catch-all-error-p (vl-catch-all-apply 'vla-load (list (vla-get-Linetypes doc) LineTypeName FileName) )) ; end vl-catch ) ; end and nil T ) ; end if ) ; end defun (defun existLinetype (doc LineTypeName / item loaded) (vlax-for item (vla-get-linetypes doc) (if (= (strcase (vla-get-name item)) (strcase LineTypeName)) (setq loaded T) ) ) ) (setq thisdrawing (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark thisdrawing) ;;Load Line Types (LoadLineType ThisDrawing "Dashed" "acad.lin") (LoadLineType ThisDrawing "Center" "acad.lin") ;;Select Reference Line (while (= MyEnt nil) (setq MyLine (car (entsel "\nSelect reference Line"))) (if (= MyLine nil) (princ "\nPity the fool, nothing selected. ") (setq MyEnt (entget MyLine)) ) ) ; end while ;;Work out 2 end points (if (= (cdr (assoc 0 MyEnt)) "LINE") (progn (setq EndA (cdr (assoc 10 MyEnt))) (setq EndB (cdr (assoc 11 MyEnt))) ) ; end progn (progn (setq EndA (cdr (assoc 10 MyEnt))) (setq EndB (cdr (assoc 10 (reverse MyEnt)))) ) ; end progn ) ; end if ;;Work out orientation (if (equal (car EndA) (car EndB) 0.0001) (progn (setq Orientation "V") ; Orientation (setq SSFilter "=,*,*") ; SSGET filter (setq EnFilter1 "caddr"); CAR / CADR Filter for entity (setq EnFilter2 "cadr") ; CAR / CADR Filter for entity ) ) (if (equal (cadr EndA)(cadr EndB) 0.0001) (progn (setq Orientation "H") (setq SSFilter "*,=,*") (setq EnFilter1 "cadr") (setq EnFilter2 "caddr") ) ) ;; Get Selection Set (if (= Orientation nil) (progn (princ "Selected line is not orthogonal") ) ; end progn no orientation (progn (princ "\nSelect Broken line: ") (if (assoc 62 MyEnt) (setq MySS (ssget (list (cons 0 "*LINE")(assoc 8 MyEnt)(assoc 62 MyEnt)(cons -4 SSFilter) (cons 10 EndA) ))) (setq MySS (ssget (list (cons 0 "*LINE")(assoc 8 MyEnt)(cons -4 SSFilter) (cons 10 EndA) ))) ) ;; Delete non ortho from SS (setq acount (sslength MySS)) (setq EndPoints (list)) (setq LineLengths (list)) (while ( > acount 0) (setq AnEnt (entget (ssname MySS (- acount 1)))) (setq LEndA (assoc 10 AnEnt)) (if (= (cdr (assoc 0 AnEnt)) "LWPOLYLINE") (progn (setq LEndB (assoc 10 (reverse AnEnt))) ) (progn (setq LEndB (assoc 11 AnEnt)) ) ) ; end if (if (and (equal ((eval (read EnFilter2)) LEndA) ((eval (read EnFilter2)) (assoc 10 MyEnt)) 0.0001) (equal ((eval (read EnFilter2)) LEndB) ((eval (read EnFilter2)) (assoc 10 MyEnt)) 0.0001) ) ; end and (progn ;;Lines to join in SS (setq EndPoints (cons ((eval (read EnFilter1)) LendA) EndPoints)) (setq EndPoints (cons ((eval (read EnFilter1)) LendB) EndPoints)) (setq LineLengths (cons (distance (cdr LendA) (cdr LendB)) LineLengths)) ) (progn ;; Remove lines from SS (setq MySS (ssdel (ssname MySS (- acount 1)) MySS)) ;; Remove line from selection set ) ; end progn ) ; end if (setq acount (- acount 1)) ) ; end while (setq EndPoints (vl-sort EndPoints '<)) ; order small to large ;;Modify Reference Line (if (< ((eval (read EnFilter1)) EndA)((eval (read EnFilter1)) EndB)) (progn (if (= (cdr (assoc 0 MyEnt)) "LINE") (if (= Orientation "H") (progn (setq MyEnt (subst (cons 11 (list (car EndPoints) (cadr EndA) (caddr EndA))) (assoc 11 MyEnt) MyEnt )) (setq MyEnt (subst (cons 10 (list (last EndPoints) (cadr EndB) (caddr EndB))) (assoc 10 MyEnt) MyEnt )) (entmod MyEnt) ) ; end progn (progn (setq MyEnt (subst (cons 11 (list (car EndA) (car EndPoints) (caddr EndA))) (assoc 11 MyEnt) MyEnt )) (setq MyEnt (subst (cons 10 (list (car EndA) (last EndPoints) (caddr EndB))) (assoc 10 MyEnt) MyEnt )) (entmod MyEnt) ) ; end progn ) ; end if (if (= Orientation "H") (progn (setq MyEnt (subst (cons 10 (list (car EndPoints) (cadr EndA))) (assoc 10 (reverse MyEnt)) MyEnt )) (setq MyEnt (subst (cons 10 (list (last EndPoints) (cadr EndB))) (assoc 10 MyEnt) MyEnt )) (entmod MyEnt) ) ; end progn (progn (setq MyEnt (subst (cons 10 (list (car EndA) (car EndPoints))) (assoc 10 MyEnt) MyEnt )) (setq MyEnt (subst (cons 10 (list (car EndA) (last EndPoints))) (assoc 10 (reverse MyEnt)) MyEnt )) (entmod MyEnt) ) ; end progn ) ; end if ) ; end if line ;; (princ "\nEnd A smaller") ) ;end progn (progn (if (= (cdr (assoc 0 MyEnt)) "LINE") (if (= Orientation "H") (progn (setq MyEnt (subst (cons 11 (list (car EndPoints) (cadr EndA) (caddr EndA))) (assoc 11 MyEnt) MyEnt )) (setq MyEnt (subst (cons 10 (list (last EndPoints) (cadr EndB) (caddr EndB))) (assoc 10 MyEnt) MyEnt )) (entmod MyEnt) ) (progn (setq MyEnt (subst (cons 11 (list (car EndA) (car EndPoints) (caddr EndA))) (assoc 11 MyEnt) MyEnt )) (setq MyEnt (subst (cons 10 (list (car EndA) (last EndPoints) (caddr EndB))) (assoc 10 MyEnt) MyEnt )) (entmod MyEnt) ) ) (if (= Orientation "H") (progn (setq MyEnt (subst (cons 10 (list (car EndPoints) (cadr EndA))) (assoc 10 MyEnt) MyEnt )) (setq MyEnt (subst (cons 10 (list (last EndPoints) (cadr EndB))) (assoc 10 (reverse MyEnt)) MyEnt )) (entmod MyEnt) ) (progn (setq MyEnt (subst (cons 10 (list (car EndA) (car EndPoints))) (assoc 10 (reverse MyEnt)) MyEnt )) (setq MyEnt (subst (cons 10 (list (car EndA) (last EndPoints))) (assoc 10 MyEnt) MyEnt )) (entmod MyEnt) ) ) ) ; end if line ;; (princ "\nEnd B smaller") ) ; end progn ) ; end if smaller ;; set MyEnt to line type - dashed / centre (setq LineLengths (vl-sort LineLengths '<)) ; order small to large (if (< (* 2 (cadr LineLengths))(cadr (reverse LineLengths))) ; 2nd longest line 2x longer than 2nd shorted line (vla-put-Linetype (vlax-ename->vla-object MyLine) "Center") (vla-put-Linetype (vlax-ename->vla-object MyLine) "Dashed") ) (setq MySS (ssDel MyLine MySS)) (command "erase" MySS "") ) ; end progn H or V ) ; end if Orientation H or V (vla-Endundomark thisdrawing) (princ) ) 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.