Author Topic: 31345 objects in P1-15AcreRON.dwg???  (Read 7930 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7533
31345 objects in P1-15AcreRON.dwg???
« Reply #15 on: March 10, 2004, 02:13:13 PM »
How would this lisp be modified to just get the total list of apps and delete them all at once rather than cycle through them and delete?

Code: [Select]
;;If you're using A2K+ (R15)...
;;  Removes the registered application
(defun c:KillApps ( / name removed cnt)
  (vl-load-com)
  (setq cnt 0)
  (if (not *acad*)(setq *acad* (vlax-get-acad-object)))
  (vlax-for app (vla-get-registeredapplications (vla-get-activedocument *acad*))
    (setq name (vla-get-name app))

    (if
      (not
        (vl-catch-all-error-p
          (vl-catch-all-apply 'vla-delete (list app))
        )
      )
      (progn
       (setq cnt (1+ cnt))
      (setq removed
        (princ
          (strcat
            "\nRemoved application \""
            name
            "\""
          )
        )
      )
      );end progn
    )
  )
  (if (not removed)
    (princ "\nNo applications were removable.")
    (print cnt)
  )
  (princ)
)


Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

daron

  • Guest
31345 objects in P1-15AcreRON.dwg???
« Reply #16 on: March 10, 2004, 04:05:25 PM »
Ron, here is a text file of all the registered apps in that drawing. This file alone is 801429Bytes and it's just the names of each app. I'm sure it'll help you find what's causing it and to avoid their use where possible in the future. I sorted them. Question: Do you have to do a lot of auditing? There sure are a lot of audit apps.

daron

  • Guest
31345 objects in P1-15AcreRON.dwg???
« Reply #17 on: March 12, 2004, 10:20:57 AM »
Quote from: ronjonp
How would this lisp be modified to just get the total list of apps and delete them all at once rather than cycle through them and delete?

I'm guessing you don't want to command line to read like this:
Quote
No applications were removable.
No applications were removable.
Removed application "SDSK_PMN"
1
Removed application "_KTI_ARCHT_BASELINE"
2
Removed application "ADE"
3
Removed application "AEC_DWGVARSSETUP_DATA"
4
Removed application "AEC_DISPREPCONFIG_DATA"
5
Removed application "AEC_DISPREPSET_DATA"
6
Removed application "AEC_ROUNDTRIP_15"
7
Removed application "RT_RJH"
8
8

Just delete them. You have to cycle through them in order to delete them, but you can remove the explanation. Take this portion:
Code: [Select]
(if
      (not
        (vl-catch-all-error-p
          (vl-catch-all-apply 'vla-delete (list app))
        )
      )
      (progn
       (setq cnt (1+ cnt))
      (setq removed
        (princ
          (strcat
            "\nRemoved application \""
            name
            "\""
          )
        )
      )
      );end progn
    )
  )
  (if (not removed)
    (princ "\nNo applications were removable.")
    (print cnt)
  )

and replace it with:
Code: [Select]
(if
(not
     (vl-catch-all-error-p
  (vl-catch-all-apply
'vla-delete
(list app)
  )
     )
)
    (setq cnt (1+ cnt))
   )

ronjonp

  • Needs a day job
  • Posts: 7533
31345 objects in P1-15AcreRON.dwg???
« Reply #18 on: March 12, 2004, 10:54:35 AM »
thanks Daron :D

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7533
31345 objects in P1-15AcreRON.dwg???
« Reply #19 on: March 19, 2004, 12:22:17 PM »
Is there a way to put an If statement so that all registered Apps are deleted except for ones starting with WID*?

Thanks,

Ron :D

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

daron

  • Guest
31345 objects in P1-15AcreRON.dwg???
« Reply #20 on: March 19, 2004, 12:29:16 PM »
Funny you ask. I originally did that for my apps. Here's the code. You need to figure out where to put it and what to remove.
Code: [Select]
(setq cnt 0)
(if (not *acad*)
     (setq *acad* (vlax-get-acad-object))
)
(setq allapp (vla-get-registeredapplications
 (vla-get-activedocument *acad*)
    )
) ;(setq name nil)
(vlax-for app allapp
 ;(setq name (append name (list (vla-get-name app)))))
     (setq name (vla-get-name app))
     (cond ((or
(wcmatch (strcase name) (strcase "*aec*"))
(wcmatch (strcase name) (strcase "*kti*"))
(wcmatch (strcase name) (strcase "*rjh*"))
(wcmatch (strcase name) (strcase "*ade*"))
(wcmatch (strcase name) (strcase "*sdsk*"))
   )
   (if
(not
     (vl-catch-all-error-p
  (vl-catch-all-apply
'vla-delete
(list app)
  )
     )
)
    (progn
 (setq cnt (1+ cnt))
 (setq removed
   (princ
(strcat
     "\nRemoved application \""
     name
     "\""
)
   )
 )
    ) ;end progn
   )
   (if (not removed)
(princ "\nNo applications were removable.")
(print cnt)
   )
  )
     )
)
     (princ)
(setq name nil
      removed nil
      cnt nil
      allapp nil
  )