2013

Table Of Contents
WARNING Do not modify the reserved acad2012.lsp file. Autodesk provides the
acad2012.lsp file, which contains AutoLISP defined functions that are required by
AutoCAD. This file is loaded into memory immediately before the acad.lsp file is
loaded.
See also:
Overview of File Organization (page 3)
Prevent AutoLISP Errors When Loading Startup Files (page 85)
The ACADDOC.LSP File
The acaddoc.lsp file is intended to be associated with each document (or
drawing) initialization. This file is useful if you want to load a library of
AutoLISP routines to be available every time you start a new drawing (or open
an existing drawing).
Each time a drawing opens, AutoCAD searches the library path for an
acaddoc.lsp file. If it finds one, it loads the file into memory. The acaddoc.lsp
file is always loaded with each drawing regardless of the settings of
ACADLSPASDOC.
Most users will have a single acaddoc.lsp file for all document-based AutoLISP
routines. AutoCAD searches for an acaddoc.lsp file in the order defined by the
library path; therefore, with this feature, you can have a different acaddoc.lsp
file in each drawing directory, which would load specific AutoLISP routines
for certain types of drawings or jobs.
The acaddoc.lsp file can contain AutoLISP code for one or more routines, or
just a series of load function calls. The latter method is preferable, because
modification is easier. If you save the following code as an acaddoc.lsp file, the
files mydocumentapp1.lsp, build.lsp, and counter.lsp are loaded every time a new
document is opened.
(load "mydocumentapp1")
(load "build")
(load "counter")
WARNING Do not modify the reserved acad2012doc.lsp file. Autodesk provides
the acad2012doc.lsp file, which contains AutoLISP-defined functions that are
required by AutoCAD. This file is loaded into memory immediately before the
acaddoc.lsp file is loaded.
84 | Chapter 7 Introduction to Programming Interfaces