Code Red > AutoLISP (Vanilla / Visual)

Cui - LISP Load Question

<< < (2/5) > >>

MSTG007:
What are your thoughts on demand load opposed to loaded all these files in every time a drawing opens? I would think it would be harder to manage. Just a question.

tombu:

--- Quote from: MSTG007 on May 20, 2019, 10:00:31 AM ---What are your thoughts on demand load opposed to loaded all these files in every time a drawing opens? I would think it would be harder to manage. Just a question.

--- End quote ---
While I have a small group of daily used lisp functions loaded with acaddoc.lsp every time a drawing opens and a few in acad.lsp to make profile modifications as necessary most of my routines are demand loaded either in the CUI command macro or with a autoload function call in acaddoc.lsp.

I have a large number of custom CUI commands that require lisp to be loaded.  If there's ever a conflict when using one of these commands from another lisp that may be using the same global variable or function name I'd be able to find and correct the conflict right away.  I use a lot of downloaded lisp and these things happen.  My PC's performance isn't as good as I'd prefer so loading all the lisp I could ever possibly use would degrade that performance more than I could put up with.

dgorsman:
Look into the help for the (load ...) function.  It has an optional argument, when used a failed load doesn't (exit) it returns that optional argument.  By checking the return value you can provide some feedback on exactly *what* failed to load.

tombu:

--- Quote from: MSTG007 on May 20, 2019, 07:10:26 AM ---I have this routine loaded within a CUI under LISP Files.
If a routine is accidently not there, the file will not load any of the routines below.
How can I get keep loading even when a file is not there?
Thanks for any help :)

--- End quote ---
This will test and load all those files that are found:
--- Code: ---(defun cui_Loader (lspfile / fpath)
  (setq fpath (strcat "\\\\Server1\\Autodesk\\CUI\\Ribbon\\" lspfile))
  (or (findfile fpath)(load fpath))
  (princ)
)
(cui_Loader "85x11_L.lsp")
(cui_Loader "85x11_P.lsp")
(cui_Loader "11X17_L.lsp")
(cui_Loader "11X17_P.lsp")
(cui_Loader "22X34_L.lsp")
(cui_Loader "22X34_P.lsp")
(cui_Loader "24X36_L.lsp")
(cui_Loader "24X36_P.lsp")
(cui_Loader "30X42_L.lsp")
(cui_Loader "30X42_P.lsp")
(cui_Loader "36X48_L.lsp")
(cui_Loader "36X48_P.lsp")
(cui_Loader "1-10.lsp")
(cui_Loader "1-20.lsp")
(cui_Loader "1-30.lsp")
(cui_Loader "1-40.lsp")
(cui_Loader "1-50.lsp")
(cui_Loader "1-60.lsp")
(cui_Loader "1-80.lsp")
(cui_Loader "1-100.lsp")
(cui_Loader "1-200.lsp")
(cui_Loader "1-500.lsp")
(princ)

--- End code ---
It's also an example of one lisp that can be used with many arguments like one that could handle all your scales.

MSTG007:
Thank you for sharing this. Its simple and makes sense. Saves a lot of headaches lol.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version