Message 1 of 3
lisp for periodically purging / cleaning drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found an old lisp on a german CAD forum to purge a drawing without having a dialog box pop up and was wondering if someone can amend it to include the following actions:
1) delete any duplicate objects (to an accuracy of 0.001) --> Command: "overkill"?
2) delete any unused scales (text, annotation, etc)
3) color -->By Layer
4) linetype --> By Layer
5) lineweight --> By Layer
6?) any other recommended purge-type features to build in?
Perhaps there's a fitting lisp out there that already exists and I just can't find it...
PS: if i wanted to create a button for this command, to add to a particular ribbon, how would I go about this? Can I create/choose a jpg (or bmp?) for this button/icon?
;************************************************************************* ;** Datei REINIG ;** Dient zum automatischen bereinigen von Zeichnungen ;************************************************************************* ;** Funktion C:REINIG ;** Hauptprogramm ;************************************************************************* ;** Autor: NAVRATIL Heinz ;** Stand: 22.11.1998 ;** Ver.: 2.0 -- AutoCAD Ver. 14 / 2000 ;************************************************************************* ;** ---------------------------------------------------------------------- ;** C:REINIG ;** ---------------------------------------------------------------------- (defun C:REINIG( / ok oldecho) (setq oldecho (getvar "CMDECHO")) (setvar "CMDECHO" 0) (setq ok T) ;* Solange OK T ist (while ok ;* Befehl BEREINIG aufrufen (command "._PURGE" "_AL" "*" "_Y") ;* Wenn der Befehl nach dem Aufruf noch aktiv ist, bedeudet das, ;* daß es noch Elemente zum Bereinigen gibt. (if (= (getvar "CMDACTIVE") 1) (progn ;* Solange der befehl aktiv ist wird mit _Y geantwortet (while (= (getvar "cmdactive") 1) (command "_Y") ) ) ;* Wenn nach dem Befehlsaufruf BEREINIG wieder beendet wird, ;* gibt es nichts mehr zu bereinigen. (setq ok nil) ) ) (setvar "CMDECHO" oldecho) 'DANKE )
Running AutoCAD Architecture 2020, in German