2013

Table Of Contents
See also:
Overview of File Organization (page 3)
Prevent AutoLISP Errors When Loading Startup Files (page 85)
The MNL File for an AutoLISP Menu
When AutoCAD loads a customization file, it searches for an MNL file with a
matching file name. If it finds the file, it loads the file into memory. This
function ensures that AutoCAD loads the AutoLISP functions that are needed
for proper operation of a menu.
This function ensures that AutoCAD loads the AutoLISP functions that are
needed for proper operation of a menu. For example, the default AutoCAD
customization file, acad.cuix, relies on the file acad.mnl. This file defines
numerous AutoLISP functions used by the menu. The MNL file is loaded after
the acaddoc.lsp file.
Prevent AutoLISP Errors When Loading Startup Files
If an AutoLISP error occurs while you are loading a startup file, the remainder
of the file is ignored and is not loaded.
Files specified in a startup file that do not exist or that are not in the AutoCAD
library path generally cause errors. Therefore, you may want to use the onfailure
argument with the load function. The following example uses the onfailure
argument:
(princ (load "mydocapp1" "\nMYDOCAPP1.LSP file not
loaded."))
(princ (load "build" "\nBUILD.LSP file not loaded."))
(princ (load "counter" "\nCOUNTER.LSP file not loaded."))
(princ)
If a call to the load function is successful, it returns the value of the last
expression in the file (usually the name of the last defined function or a
message regarding the use of the function). If the call fails, it returns the value
of the onfailure argument. In the preceding example, the value returned by the
load function is passed to the princ function, causing that value to be displayed
at the command prompt.
AutoLISP | 85