Author Topic: Overkill for blocks.  (Read 1883 times)

0 Members and 1 Guest are viewing this topic.

Lonnie

  • Newt
  • Posts: 176
Overkill for blocks.
« on: December 17, 2021, 11:12:07 AM »
I would be happy enough to do each block on it's own and not overkill overlapped blocks.

I have to figure this has been covered many times but I can't seem to find (and I did look) a decent one to start with. I am more of a hack than anything. A good base to start from would help me out tremendously.

Does anyone know of a block overkill command that will do nested blocks(both deep and wide? I have a 60 mb dwg with many many nested blocks that could use a good overkill. This was just one block.


2821 duplicate(s) deleted
18181 overlapping object(s) or segment(s) deleted

Some of the blocks have had 6 nested blocks and I went as deep as 4 blocks in one of those. I know I am going to miss some parts.

I would be happy enough to do each block on it's own and not  overkill overlapped blocks.

I added a rather simple (That has most of the problems.) block to show what I want to overkill.)

Anyway I haope that makes since.
Thanks Everyone.
« Last Edit: December 17, 2021, 11:17:40 AM by Lonnie »

mhupp

  • Bull Frog
  • Posts: 250
Re: Overkill for blocks.
« Reply #1 on: December 17, 2021, 12:22:56 PM »
This will explode all the nested blocks in the drawing. and make "happy enough to do each block on it's own" alot easier.
https://www.cadtutor.net/forum/topic/41164-explode-nested-blocks-only/?tab=comments#comment-336071
there is another lisp down that allows you to explode only nested blocks inside blocks you pick.

« Last Edit: December 17, 2021, 12:30:54 PM by mhupp »

Lonnie

  • Newt
  • Posts: 176
Re: Overkill for blocks.
« Reply #2 on: December 17, 2021, 12:58:42 PM »
Better. It went up in size before the overkills but by the time I was done it was smaller than before. I think there are a few duplicated blocks that were hurt but overall it was better than manually finding everything.

Thanks.

mhupp

  • Bull Frog
  • Posts: 250
Re: Overkill for blocks.
« Reply #3 on: December 17, 2021, 01:30:58 PM »
Do you remember the sizes kinda curious? Also good to run audit after purging a bunch of stuff might bring down the file size a bit more.

Lonnie

  • Newt
  • Posts: 176
Re: Overkill for blocks.
« Reply #4 on: December 17, 2021, 02:46:44 PM »
Roughly.

Total starting size
60 megs.

Ran a routine to purge, delete hatches,  delete all frozen layers
35 meg in size.
 
After hand overkill.
22 megs in size.

exploded nested and hand overkill
15.0 MB (15,820,978 bytes)

Not good but much more acceptable.

The company does it all the time but normally the blocks are wide without so many deeply nested block. When I get time I think I will see about making something to overkill all the blocks. I was hoping for an easy button today. lol


mhupp

  • Bull Frog
  • Posts: 250
Re: Overkill for blocks.
« Reply #5 on: December 18, 2021, 12:25:58 AM »
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/overkill-all-blocks/m-p/8399738/highlight/true#M376996

Don't know if your working in 2d or 3d but splines eat up a lot of space to.

Code - Auto/Visual Lisp: [Select]
  1. ;;----------------------------------------------------------------------------;;
  2. ;; Converts Spline to Polyline
  3. (defun C:S2P (/ cnt SS)
  4.   (setq cnt 0)
  5.   (if (setq SS (ssget "X" '((0 . "SPLINE"))))
  6.     (progn
  7.       (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
  8.         (vl-cmdf "_.Flatten" e "")
  9.         (setq cnt (1+ cnt))
  10.       )
  11.       (prompt (strcat "\n" (itoa cnt) " Splines Converted"))
  12.     )
  13.   )
  14.   (princ)
  15. )