Jump to content
daniil

Superpurge

Recommended Posts

daniil

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

Share this post


Link to post
Share on other sites
myloveflyer
(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?

Share this post


Link to post
Share on other sites
daniil
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?

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...