TheSwamp

CAD Forums => CAD General => Topic started by: notredave on June 04, 2019, 12:29:45 PM

Title: Purge script not working
Post by: notredave 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
Title: Re: Purge script not working
Post by: 57gmc on June 04, 2019, 12:55:54 PM
What makes you think its not working? Can you purge the file normally without the script?
Title: Re: Purge script not working
Post by: ronjonp 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)
Title: Re: Purge script not working
Post by: notredave 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.
Title: Re: Purge script not working
Post by: ronjonp on June 04, 2019, 02:28:11 PM
Make sure the sub is loaded then: _.open *file* (_purge) _.close y