Nikon Posted 1 hour ago Posted 1 hour ago (edited) Good day everyone! I want to add several lisp files to the startup at once. I have a list of lisp files in notepad, in the Support folder. The code returns an error: no function definition: VLA-GET-STARTUPSUITE (defun c:add-list-lisps-to-startup ( / file line folder fullpath app ssuite ) (vl-load-com) ;; The folder where the LISP files are located (setq folder "C:/Program Files/Autodesk/AutoCAD 2021/Support/") ;; Opening the list file (setq file (open "C:/Program Files/Autodesk/AutoCAD 2021/Support/list_startup.txt" "r")) (if file (progn ;; Getting the object Application (setq app (vlax-get-acad-object)) (setq ssuite (vla-get-StartupSuite app)) (while (setq line (read-line file)) (setq line (vl-string-trim " \t\r " line)) (if (and line (> (strlen line) 0)) (progn (setq fullpath (strcat folder line)) (if (findfile fullpath) (progn (vla-Add ssuite fullpath) (princ (strcat "Added to auto-upload: " fullpath)) ) (princ (strcat "File not found: " fullpath)) ) ) ) ) ; end while (close file) (princ "All files from the list have been processed.") ) ; end progn (princ "Couldn't open the list file.") ) ; end if (princ) ) ; end defun Edited 1 hour ago by Nikon Quote
ronjonp Posted 57 minutes ago Posted 57 minutes ago (edited) That is because that is an AI generated function that does not exist. Rather than add them to the startup suite, just load them using one lisp file: (defun loadlisp (path / lst pth) (if (and (setq pth (strcat (vl-string-right-trim "\\" path) "\\")) (setq lst (vl-directory-files pth "*.lsp" 1)) ) (foreach x (mapcar 'vl-filename-base lst) (vl-catch-all-apply 'load (list (strcat pth x)))) ) (princ) ) (loadlisp "C:\\Program Files\\Autodesk\\AutoCAD 2021\\Support\\") Easy to inspect in the vlide: Edited 51 minutes ago by ronjonp Quote
Nikon Posted 13 minutes ago Author Posted 13 minutes ago 43 minutes ago, ronjonp said: Rather than add them to the startup suite, just load them using one lisp file: I need to add 50 lisp programs to autoload... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.