Removing Registered Applications

Discussion in 'AutoCAD' started by Al Strominger, Sep 22, 2004.

  1. I have hundreds of sheet files that are over 4MB due to applications. If I
    rebuild a file (wblock out ms, ps - new file - insert ms, ps, attach xref's)
    they are about 100k as expected. Usually SuperPurge does a great job, but I
    started spurge on one of the files (no xref's) over 2 hours ago and it is
    still chugging.
    Does anybody have any great ideas?
     
    Al Strominger, Sep 22, 2004
    #1
  2. Al Strominger

    Jim Claypool Guest

    This will remove all registered applications that are not being used

    (defun c:RemRegApps ( / cnt totcnt)
    (setq cnt 0 totcnt 0 app_list nil)
    (setq *acad* (vlax-get-acad-object))
    (setq *doc* (vla-get-activedocument *acad*))
    (vlax-for RegApp (vla-get-registeredapplications *doc*)
    (setq totcnt (1+ totcnt))
    (if
    (vl-catch-all-error-p
    (vl-catch-all-apply 'vla-delete (list RegApp))
    )
    (progn
    (setq app_list (cons (vla-get-name RegApp) app_list))
    (princ
    (strcat
    "\n" (vla-get-name RegApp)
    " could not be deleted."
    ))
    )
    (setq cnt (1+ cnt))
    )
    )
    (princ
    (strcat
    "\nDeleted "
    (itoa cnt)
    " of "
    (itoa totcnt)
    " Registered Applications."
    ))
    (princ)
    )
     
    Jim Claypool, Sep 22, 2004
    #2
  3. Thanks Jim,
    This appears to be the same as CDGpurge, which will remove some of the apps
    (enough so I can go back and spurge the rest), but it still takes an hour to
    scan a file - even on a graphically blank file. I was hoping there was some
    way of removing apps without hours of scanning. I will run your code in a
    batch script overnight and see how many files it can process.

    Thanks Again

    Al




    This will remove all registered applications that are not being used

    (defun c:RemRegApps ( / cnt totcnt)
    (setq cnt 0 totcnt 0 app_list nil)
    (setq *acad* (vlax-get-acad-object))
    (setq *doc* (vla-get-activedocument *acad*))
    (vlax-for RegApp (vla-get-registeredapplications *doc*)
    (setq totcnt (1+ totcnt))
    (if
    (vl-catch-all-error-p
    (vl-catch-all-apply 'vla-delete (list RegApp))
    )
    (progn
    (setq app_list (cons (vla-get-name RegApp) app_list))
    (princ
    (strcat
    "\n" (vla-get-name RegApp)
    " could not be deleted."
    ))
    )
    (setq cnt (1+ cnt))
    )
    )
    (princ
    (strcat
    "\nDeleted "
    (itoa cnt)
    " of "
    (itoa totcnt)
    " Registered Applications."
    ))
    (princ)
    )
     
    Al Strominger, Sep 22, 2004
    #3
  4. Al Strominger

    Jim Claypool Guest

    Oops! Thanks Luis. I changed RegApp to AppId.
    Just another thouoght, if you wblock the entire drawing, the unused apps
    should go away.

    (defun c:RemRegApps ( / cnt totcnt)
    (setq cnt 0 totcnt 0 app_list nil)
    (setq *acad* (vlax-get-acad-object))
    (setq *doc* (vla-get-activedocument *acad*))
    (vlax-for AppId (vla-get-registeredapplications *doc*)
    (setq totcnt (1+ totcnt))
    (if
    (vl-catch-all-error-p
    (vl-catch-all-apply 'vla-delete (list AppId))
    )
    (progn
    (setq app_list (cons (vla-get-name AppId) app_list))
    (princ
    (strcat
    "\n" (vla-get-name AppId)
    " could not be deleted."
    ))
    )
    (setq cnt (1+ cnt))
    )
    )
    (princ
    (strcat
    "\nDeleted "
    (itoa cnt)
    " of "
    (itoa totcnt)
    " Registered Applications."
    ))
    (princ)
    )
     
    Jim Claypool, Sep 22, 2004
    #4
  5. Al Strominger

    Don Butler Guest

    This will list their names...

    (defun c:RegAppNames (/ lis fil)
    (setq *acad* (vlax-get-acad-object))
    (setq *doc* (vla-get-activedocument *acad*))
    (vlax-for AppId (vlax-get *doc* 'registeredapplications)
    (setq lis (cons (vla-get-name AppId) lis))
    )
    (setq fil (open "C:\\RegApps.Txt" "w"))
    (setq lis (acad_strlsort lis))
    (foreach n lis (write-line n fil))
    (close fil)
    (startapp "Notepad.exe C:\\RegApps.Txt")
    )

    I wonder if there is any danger in removing them?

    Don
     
    Don Butler, Sep 23, 2004
    #5
  6. Al Strominger

    John Uhden Guest

    Been through this. Can't find a way to prevent the tedious scanning, even using
    ObjectDBX on a "non-active" drawing.
     
    John Uhden, Sep 23, 2004
    #6
  7. Al Strominger

    JeffPaulsen Guest

    You can purge regapps in AutoCAD 2005. It needs to be run from the command line version (-purge).

    It purges considerably faster than CDPurge or SuperPurge.

    However, I have run into a problem that it locks up on certain drawings. I have narrowed the culprit appid to one whose name starts with Genius.
     
    JeffPaulsen, Nov 9, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.