Hi all,
I am running -wblock in a drawing to clean it up and reduce the file size. By doing this it brings the file size down from over 9 meg to just over 1 meg by removing unused blocks that are not able to be purged out of the drawing using the purge all command.
My problem is, when I run the -wblock manually at the command prompt it works fine. But, when I run it inside a simple lisp routine
^C^C^P(command "-wblock" (strcat (getvar "dwgprefix") "CLEAN_" (getvar "dwgname"))"*") ^P^C^C
It appears to work fine without errors. It creates the new file with the correct file name. But it only reduces the same file size to just over 8 meg
Any ideas?
Thank in advance
Scott
Solved! Go to Solution.
Solved by Jason.Piercey. Go to Solution.
Can you provide a link to download the file? I assume the 9mb is too large to post here.
There is no file. It's just the single line of code that isn't working. Actually, it is working (no errors) but the resulting file is not cleaned like it is when I run the -wblock command manually with the "*" input.
Scott
I understand that. I'm asking for the dwg file, so I see if I get the same results.
I didn't think you would want the file since we don't know what is causing the drawings to get so bloated. It appears to be from an architectural drawing we received from a customer. and it has spread to an unknown number of drawings. We've isolated the source and now want to clean up the mess.
I have attached a zipped file for you to test.
Thanks,
Scott
I don't get the same results as you. The file is reduced significantly regardless of which method I use. If I -wblock manually the resulting file is 567kb. If I cut/paste your code to the command line the resulting file is 569kb.
Seems that anonymous blocks are causing the bloat. If I delete the "ACAD_DGNLINESTYLECOMP" dictionary I can then purge 7560 anonymous blocks. After saving the file, it is now 565kb.
I wonder why it doesn't work for me. Maybe deleting the dictionary and purging is the better way. Where do I find the dictionary to delete it?
Thanks,
Scott
I have this as one of my toolbox functions.
; [dictName] - string, dictionary name (defun deldict (dictName) (dictremove (namedobjdict) dictName) )
You can use it like this:
(deldict "ACAD_DGNLINESTYLECOMP")
That worked perfectly! I think I'll use that instead of the -wblock
Thanks very much for helping me with that
Scott
I have one more question. This process doesn't seem to be consistent. Sometimes it will greatly reduce the file size, and other times it will reduce it not as much. do you know why this happens? Is there another process that might work better?
Any info is appreciated
THanks,
Scott
You deleted the dictionary and also purged? Can you provide an additional sample file where the size is not reduced? It's quite possible a different issue is keeping the file bloated.
Hi Jason,
Yes I did both, a couple of times. Attached is a sample file you requested. Perhaps you can figure out why?
Thanks,
Scott
I don't know why. It had a drawing in it when I uploaded it.
Try this one
I don't know why. It had a drawing in it when I uploaded it.
Try this one
Excuse all the postings. I didn't realize my computer was lagging so I hit the post button a couple of times
What are you seeing as a file size after deleting the dictionary and purging? I'm getting about 1.9mb.