Beginning with the AutoCAD 2000 release, AutoCAD uses different startup files for the automatic loading of AutoLISP, when compared to previous versions of AutoCAD. This solution discusses the user-defined startup files acad.lsp and acaddoc.lsp, and the reserved startup files acad2000.lsp and acad2000doc.lsp (later releases will include the year corresponding to that release, e.g., acad2011.lsp and acad2011doc.lsp).
acad.lspWhen you start AutoCAD, it searches the library path for a file called acad.lsp. If the file is found, AutoCAD loads it. AutoCAD loads
acad.lsp once only, at the beginning of the drawing session.
Functions and variables defined in
acad.lsp are only available in the first drawing in an AutoCAD session. If you want a routine to be available in all drawings in the session, include it in the user-defined startup file
acaddoc.lsp.
Note: AutoCAD 2000 is not supplied with the user-defined startup file acad.lsp; you create and maintain the file yourself.
acaddoc.lspEvery time a drawing opens (that is, when you start a new drawing or open an existing drawing), AutoCAD searches the library path for a file called
acaddoc.lsp. If the file is found, AutoCAD loads it.
Note: AutoCAD always loads acaddoc.lsp regardless of the settings for the ACADLSPASDOC and LISPINIT system variables.
Functions and variables defined in
acaddoc.lsp are available in all drawings in the AutoCAD session.
In most situations, you only need one
acaddoc.lsp file, but you can use different versions of the file. For example, because AutoCAD searches the library path for
acaddoc.lsp, you could place a different
acaddoc.lsp in each drawing directory. Then AutoCAD would load specific AutoLISP routines for certain types of drawings or jobs.
Note: AutoCAD 2000 is not supplied with the user-defined startup file acaddoc.lsp; you create and maintain the file yourself.
ACADLSPASDOC system variableYou can use ACADLSPASDOC to override the recommended functionality of
acad.lsp. If ACADLSPASDOC is set to 0 (the default setting),
acad.lsp is loaded once, at the beginning of the drawing session. If ACADLSPASDOC is set to 1,
acad.lsp is reloaded every time a drawing opens.
ACADLSPASDOC and SDI modeACADLSPASDOC is ignored in SDI (single document interface) mode. When the SDI system variable is set to 1, LISPINIT controls the reinitialization of AutoLISP between drawings. When LISPINIT is set to 1, AutoLISP functions and variables are valid in the current drawing only; each time you start a new drawing or open an existing one, all functions and variables are cleared from memory and
acad.lsp is reloaded. Changing the value of LISPINIT when SDI is set to 0 has no effect.
acad2000.lspDo not modify the reserved file
acad2000.lsp; it contains AutoLISP-defined functions required by AutoCAD. The file
acad2000.lsp is loaded into memory immediately before
acad.lsp.
acad2000doc.lspDo not modify the reserved file
acad2000doc.lsp; it contains AutoLISP-defined functions required by AutoCAD. The file
acad2000doc.lsp is loaded into memory immediately before
acaddoc.lsp.