2012

Table Of Contents
Before you can use an AutoLISP application, it must first be loaded. You can
use the APPLOAD command or the AutoLISP load function to load an
application. Loading an AutoLISP application loads the AutoLISP code from
the LSP file into your system's memory.
Loading an application with the load function involves entering AutoLISP
code at the command prompt. If the load function is successful, it displays
the value of the last expression in the file at the command prompt. This is
usually the name of the last function defined in the file or instructions on
using the newly loaded function. If load fails, it returns an AutoLISP error
message. A load failure can be caused by incorrect coding in the file or by
entering the wrong file name at the command prompt. The syntax for the
load function is
(load
filename
[onfailure]
)
This syntax shows that the load function has two arguments: filename, which
is required, and onfailure, which is optional. When loading an AutoLISP file at
the command prompt, you typically supply only the filename argument. The
following example loads the AutoLISP file newfile.lsp.
Command: (load "newfile")
The .lsp extension is not required. This format works for any LSP file in the
current library path.
To load an AutoLISP file that is not in the library path, you must provide the
full path and file name as the filename argument.
Command: (load "/files/morelisp/newfile")
NOTE When specifying a directory path, you must use a slash (/) or two backslashes
(\\) as the separator, because a single backslash has a special meaning in AutoLISP.
See also:
Overview of File Organization (page 3)
AutoLISP | 79