TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Chillme1 on December 20, 2021, 10:31:27 AM

Title: Load or Code Issue? Invoking Lisp from Command Line
Post by: Chillme1 on December 20, 2021, 10:31:27 AM
Before a needed back-to-basics LISP learning series, I ask:
What is needed to make this borrowed lisp routine run?

After ensuring the attached lisp file routine is in the SFSP and the loading it (load "deletelayerstate"), AutoCAD proudly announces that the LOAD failed.

Code - Auto/Visual Lisp: [Select]
  1. (defun c:deletelayerstate (/ lsp pat s)
  2. (setvar "cmdecho" 0)
  3. (if (setq lst (a+layerstatelist))
  4. (foreach s lst
  5. (princ (strcat "\n" s))
  6. );foreach
  7. (setq pat (getstring "\nType name or patern of layerstates to delete: "))
  8. (command "_-Layer" "_State" )
  9. (foreach s lst
  10. (if (wcmatch s pat)
  11. (beep)
  12. (command "_delete" s)
  13. (princ (strcat "\n" s " - deleted"))
  14. );progn
  15. );if
  16. );foreach
  17. (command "" "")
  18. );progn
  19. );if
  20. );defun
Title: Re: Load or Code Issue? Invoking Lisp from Command Line
Post by: JohnK on December 20, 2021, 10:51:31 AM
You need to find the following functions (and load those at the same time as this one):
(a+laterstatelist)
(beep)
Title: Re: Load or Code Issue? Invoking Lisp from Command Line
Post by: Chillme1 on December 20, 2021, 02:42:19 PM
Ah-ha! Delving into web history...!

Thanks,