Author Topic: Purge script not working  (Read 285 times)

0 Members and 1 Guest are viewing this topic.

notredave

  • Newt
  • Posts: 105
Purge script not working
« on: June 04, 2019, 12:29:45 PM »
All,

Good afternoon. Can someone please tell me why this script isn't working? I am using Lee Mac's script writer. And if someone doesn't mind adding purging regapps, I would appreciate it.

_.open *file* -purge A  N _.close y

Thank you much,
David

57gmc

  • Newt
  • Posts: 86
Re: Purge script not working
« Reply #1 on: June 04, 2019, 12:55:54 PM »
What makes you think its not working? Can you purge the file normally without the script?

ronjonp

  • Needs a day job
  • Posts: 7025
Re: Purge script not working
« Reply #2 on: June 04, 2019, 01:02:51 PM »
Try something like this .. you're forgetting the "*" in the prompts. This will do regapps as well.
Code - Auto/Visual Lisp: [Select]
  1. (defun _purge nil
  2.   (setvar 'cmdecho 0)
  3.   (foreach x '("_A" "_R") (command ".-purge" x "*" "_N"))
  4.   (setvar 'cmdecho 1)
  5.   (princ)
  6. )
  7. (_purge)

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

notredave

  • Newt
  • Posts: 105
Re: Purge script not working
« Reply #3 on: June 04, 2019, 01:59:31 PM »
ronjonp,

Thank you for this but how will this work in a script file? I am using Lee Mac's script writer.

ronjonp

  • Needs a day job
  • Posts: 7025
Re: Purge script not working
« Reply #4 on: June 04, 2019, 02:28:11 PM »
Make sure the sub is loaded then: _.open *file* (_purge) _.close y

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC