daniil Posted January 21, 2021 Posted January 21, 2021 Hello everyone!I think this topic has been raised 100 times, but unfortunately I did not find an answer that I would not like.I would like a lisp superpurge with explodeallproxy removeallproxy audit and purge. I would be grateful for your help Quote
myloveflyer Posted January 22, 2021 Posted January 22, 2021 (defun dicts (n / xdoc xdicts xi xc xii xlst xname xnl xhl myGetCount) (defun myGetCount ( xd xn / xitem errobj) (setq xitem (vla-item xd xn) errobj (vl-catch-all-apply 'vla-get-count (list xitem))) (if (vl-catch-all-error-p errobj) "#n/a" (itoa errobj) ) ) ; end of myerr() (vl-load-com) ;(textscr) (command "Undo" "c" "n") (setq xdoc (vla-get-ActiveDocument (vlax-get-Acad-Object)) xdicts (vla-get-dictionaries xdoc) xdictlist (entget (namedobjdict)) xi 0 xc (length xdictlist) xii 0 xnl nil xhl nil ) (while (< xi xc) ; for each element in xdictlist, the dictionary list (if (= (car (setq xlst (nth xi xdictlist))) 3) (progn (setq xii (1+ xii) xi (1+ xi)) ;(princ (strcat (itoa xii) ". \"" (setq xname (cdr xlst)) "\" " (myGetCount xdicts xname) "\n")) (setq xnl (cons xname xnl) xhl (cons (cdr (nth xi xdictlist)) xhl)) ) ; end of progn(it's a dictionary item) ) ; end of if(it's a dictionary item) (setq xi (1+ xi)) ) ; end of while(each element in dictionary list) ;(princ (strcat "\nActiveDocument.Dictionaries.Count=" (itoa (vla-get-count xdicts)) "\n")) (initget 6) ; no zero or negative value allowed (setq xnl (reverse xnl) xhl (reverse xhl) xi n) (if (and xi (<= xi xii)) (entdel (nth (1- xi) xhl))) (command "Undo" "a") (princ n) ) ; end of (C:dicts) (dicts 4) (dicts 5) (dictremove (namedobjdict) "ACAD_DGNLINESTYLECOMP") (command "purge" "a" "" "n" "") (prin1) Maybe? Quote
daniil Posted February 2, 2021 Author Posted February 2, 2021 On 22/01/2021 at 10:49, myloveflyer said: (defun dicts (n / xdoc xdicts xi xc xii xlst xname xnl xhl myGetCount) (defun myGetCount ( xd xn / xitem errobj) (setq xitem (vla-item xd xn) errobj (vl-catch-all-apply 'vla-get-count (list xitem))) (if (vl-catch-all-error-p errobj) "#n/a" (itoa errobj) ) ) ; end of myerr() (vl-load-com) ;(textscr) (command "Undo" "c" "n") (setq xdoc (vla-get-ActiveDocument (vlax-get-Acad-Object)) xdicts (vla-get-dictionaries xdoc) xdictlist (entget (namedobjdict)) xi 0 xc (length xdictlist) xii 0 xnl nil xhl nil ) (while (< xi xc) ; for each element in xdictlist, the dictionary list (if (= (car (setq xlst (nth xi xdictlist))) 3) (progn (setq xii (1+ xii) xi (1+ xi)) ;(princ (strcat (itoa xii) ". \"" (setq xname (cdr xlst)) "\" " (myGetCount xdicts xname) "\n")) (setq xnl (cons xname xnl) xhl (cons (cdr (nth xi xdictlist)) xhl)) ) ; end of progn(it's a dictionary item) ) ; end of if(it's a dictionary item) (setq xi (1+ xi)) ) ; end of while(each element in dictionary list) ;(princ (strcat "\nActiveDocument.Dictionaries.Count=" (itoa (vla-get-count xdicts)) "\n")) (initget 6) ; no zero or negative value allowed (setq xnl (reverse xnl) xhl (reverse xhl) xi n) (if (and xi (<= xi xii)) (entdel (nth (1- xi) xhl))) (command "Undo" "a") (princ n) ) ; end of (C:dicts) (dicts 4) (dicts 5) (dictremove (namedobjdict) "ACAD_DGNLINESTYLECOMP") (command "purge" "a" "" "n" "") (prin1) Maybe? I dont understand how this lisp run. What word i must write? 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.