Author Topic: [Community Project] Clean Drawing Program  (Read 19943 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: [Community Project] Clean Drawing Program
« Reply #15 on: December 10, 2012, 11:36:03 AM »
The only problem is that I have not mastered enough English to do the translation.

Your English is far better than my French! (and I studied French for 7 years  :lmao: )

And as I have online, I was wondering what software did you animate your pictures to better explain your lisps

I use Camtasia  :-)


Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: [Community Project] Clean Drawing Program
« Reply #16 on: December 10, 2012, 11:45:40 AM »
Lee, or whomever: 

With a quick glance, I did not see where regapps were getting purged.  IN the past I have had to specifically call the purging of those but with the new fancy code it might be already taken care of.

**EDIT**
maybe throw in a file save?   :| :|
« Last Edit: December 10, 2012, 12:08:14 PM by Krushert »
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: [Community Project] Clean Drawing Program
« Reply #17 on: December 10, 2012, 12:17:44 PM »
With a quick glance, I did not see where regapps were getting purged.  IN the past I have had to specifically call the purging of those but with the new fancy code it might be already taken care of.

Currently, I believe the regapps are being purged by the call to the Purge command with the 'All' option selected; however, you may be correct in that this option does not include regapps.

However, I intend to write separate functions for removing these items when incorporating the ability for the user to select the groups of items to be 'cleaned', rather than using the in-built Purge command.

**EDIT**
maybe throw in a file save?   :| :|

Risky should something important be accidentally removed...  :|

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine

kruuger

  • Swamp Rat
  • Posts: 635
Re: [Community Project] Clean Drawing Program
« Reply #19 on: December 10, 2012, 12:53:53 PM »
Since this will be a general program for all to use, multilanguage support will be a necessity - though, I'll certainly need your's (& Google's) help with this!
of course will be happy to help with polish translation.

i even wrote (community program) some translator. if someone is interesting please see attached sample file:
- makeblock.lsp - program with comments to translate
- tooltranslator.lsp
- library function - cadpack

more here -> http://forum.cad.pl/cadpl-pack-v1-lsp-t78161.html
kruuger

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: [Community Project] Clean Drawing Program
« Reply #20 on: December 10, 2012, 04:08:28 PM »
I vote for removal of AEC Dictionaries in regular AutoCAD. If we could automate exploding AEC objects to blocks in regular AutoCAD, that would be even better.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: [Community Project] Clean Drawing Program
« Reply #21 on: December 10, 2012, 04:11:34 PM »
Frustrating thread is frustrating. Subtitle: <I believe> there's sooooo much I could add to this thread, but I cannot under my current terms of employ. Having said that, there is tons of talent herein so my lack of participation is only a consequence for me. Kudos ya'll.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Pepe

  • Newt
  • Posts: 87
Re: [Community Project] Clean Drawing Program
« Reply #22 on: December 10, 2012, 06:19:15 PM »
Hi Lee Mac...

Sorry to say that '(command "_.-scalelistedit" "_D" "*" "_E")' doesn't work (in my version, at least...). It spits something like (traslating...) 'The scale "*" does not exists.'

I've tried via Dictionaries. I've used sometimes simply '(dictremove (namedobjdict) "ACAD_SCALELIST")' and file size decreased quite a lot. But, I've gone a little bit further, and I've tried this now:

Code - Auto/Visual Lisp: [Select]
  1. (setq scls (dictsearch (namedobjdict) "ACAD_SCALELIST"))
  2. (foreach n scls
  3. (if (= (car n) 350) (setq lscl (cons (cadr n) lscl)))
  4. )
  5. (mapcar 'entdel lscl)
  6.  

'SCALE' entities disappear, but if you call the command "_scalelistedit", scales are still there... :-o... :ugly:

Well. Curious, isn't it?

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: [Community Project] Clean Drawing Program
« Reply #23 on: December 11, 2012, 08:21:57 AM »
I've tried via Dictionaries. I've used sometimes simply '(dictremove (namedobjdict) "ACAD_SCALELIST")' and file size decreased quite a lot. But, I've gone a little bit further, and I've tried this now:
I'd be extremely careful about simply erasing the scales dictionary or any one scale from that. And you will keep on seeing them in the scales list because ACad tries to fix this possible crash situation of having no scales to display.

You need at least one scale left in the DWG. And you actually shouldn't delete scales which has been applied to something - that tends to crash acad. Erasing all scales' dictionaries do not test for scales being applied before deleting them. Anyhow thus use the Reset option in the scalelistedit command - that's a lot safer. Otherwise you'll need to step through everything in the DWG to see which scales can be erased.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Pepe

  • Newt
  • Posts: 87
Re: [Community Project] Clean Drawing Program
« Reply #24 on: December 11, 2012, 12:10:49 PM »
I've tried via Dictionaries. I've used sometimes simply '(dictremove (namedobjdict) "ACAD_SCALELIST")' and file size decreased quite a lot. But, I've gone a little bit further, and I've tried this now:
I'd be extremely careful about simply erasing the scales dictionary or any one scale from that. And you will keep on seeing them in the scales list because ACad tries to fix this possible crash situation of having no scales to display.

You need at least one scale left in the DWG. And you actually shouldn't delete scales which has been applied to something - that tends to crash acad. Erasing all scales' dictionaries do not test for scales being applied before deleting them. Anyhow thus use the Reset option in the scalelistedit command - that's a lot safer. Otherwise you'll need to step through everything in the DWG to see which scales can be erased.

Irneb, thank you very much for your advices!

My problems with scales came from a DWG file I recieved from a partner, used as a XREF in a project, in which I detected 6832 different scales (I suppose inherited from other drawings). Every drawing with that XREF attached took about 3 minutes to open ( :realmad: !!!). After I detected the problem, I just deleted the dictionary (the way I've posted), and saved... and it worked: default scales list were re-built as the file was opened without any other problem, 300kb saved in HD and few seconds to open drawings (sometimes, I go breathless, I swear  :doa:).

Just another curiosity 'to whom it may concern': I've used "scalelistedit" (NOT "-scalelistedit") against those 6832 scales, and it appears an error message saying "Matrix index out of range"... :?  Of course, "-scalelistedit", option "Reset", works properly.

Regards.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: [Community Project] Clean Drawing Program
« Reply #25 on: December 11, 2012, 12:28:03 PM »
Do you guys want to match it up against a .NET version?
 
I was just going to Wblock the entire drawing then save it back to same file.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: [Community Project] Clean Drawing Program
« Reply #26 on: December 12, 2012, 01:33:06 AM »
My problems with scales came from a DWG file I recieved from a partner, used as a XREF in a project, in which I detected 6832 different scales (I suppose inherited from other drawings). Every drawing with that XREF attached took about 3 minutes to open ( :realmad: !!!).
This is why I'm saying ADesk are idiots with the scales list. They don't have a clue about what a scale-name is supposed to be. They should never have written the extra code to affix that _XREF to the scale's name when loaded from a xref - there's no benefit to it and it causes this exponential growth in scales.

Just another curiosity 'to whom it may concern': I've used "scalelistedit" (NOT "-scalelistedit") against those 6832 scales, and it appears an error message saying "Matrix index out of range"... :?  Of course, "-scalelistedit", option "Reset", works properly.
That's because it's trying to load all 6832 names into the list for display in the dialog. And that listbox has a maximum length.

BTW, older acads popped up with that message due to the same list being displayed in the status bar - so you got that message simply by opening a dwg. Newer acads have an option to "Hide XRef Scales" so these are then not displayed in that dialog / status bar list. Though it only solves the issue of this error message, the _XREF scales are still there causing the usual slowdowns, they're just "out-of-sight-out-of-mind".
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Pepe

  • Newt
  • Posts: 87
Re: [Community Project] Clean Drawing Program
« Reply #27 on: December 12, 2012, 03:33:19 AM »
Irneb, thank you very much, again, for your advices...  8-)!

In Spain, we have a funny and rough way to say that someone has been taught. In direct translation from spanish... he or she has been dis-donkeyed (yes, from donkey, that also means in spanish, dunce). So, I've been dis-donkeyed a lot about dealing with scales!

Regards.

Peter2

  • Swamp Rat
  • Posts: 653
Re: [Community Project] Clean Drawing Program
« Reply #28 on: March 23, 2015, 05:11:25 PM »
AutoCAD >= 2012 has a standard-purge-command for "groups". Is the code here different from the "internal-purge"?
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

ur_naz

  • Newt
  • Posts: 68
  • Made in Ukraine
Re: [Community Project] Clean Drawing Program
« Reply #29 on: March 25, 2015, 02:17:09 PM »
Think it is not a good idea to put all purge routines in single command because lisp is too slow even if compiled. On huge drawings it will freeze or even crash autocad