

The acaddoc.lsp file is always loaded with each drawing regardless of the settings of ACADLSPASDOC. If it finds one, it loads the file into memory. 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).Įach time a drawing opens, AutoCAD searches the library path for an acaddoc.lsp file. The acaddoc.lsp file is intended to be associated with each document (or drawing) initialization.
#LISP FOR AUTOCAD 2014 CODE#
If you save the following code as an acad.lsp file, the files mysessionapp1.lsp, databasesynch.lsp, and drawingmanager.lsp are loaded every time you start the program.

The latter method is preferable, because modification is easier.
#LISP FOR AUTOCAD 2014 SERIES#
The acad.lsp file can contain AutoLISP code for one or more routines, or just a series of load function calls. If set to 1, the acad.lsp file is reloaded when a new drawing is created or an existing drawing file is opened. If the ACADLSPASDOC system variable is set to 0 (the default setting), the acad.lsp file is loaded just once: upon application startup. The recommended functionality of acad.lsp and acaddoc.lsp can be overridden with the ACADLSPASDOC system variable. You will probably want to move routines that should be available in all documents from your acad.lsp file into the acaddoc.lsp file. If an acad.lsp file is found, it is loaded into memory.īecause the acad.lsp file is intended to be used for application-specific startup routines, all functions and variables defined in an acad.lsp file are only available in the first drawing. When you start AutoCAD, it searches the support file search path for an acad.lsp file. You can create an acad.lsp file if you regularly use specific AutoLISP routines. It is up to the user to create and maintain these files. The acad.lsp and acaddoc.lsp startup files are not provided with AutoCAD-based products. As an alternative, the APPLOAD command provides a Startup Suite option that loads the specified applications without the need to edit any files. If one of these files defines a function of the special type S::STARTUP, this routine runs immediately after the drawing is fully initialized. The default method for loading these startup files can be modified by changing the setting of the ACADLSPASDOC system variable. This lets you associate the loading of the acad.lsp file with application startup, and the acaddoc.lsp file with document (or drawing) startup. AutoCAD-based products load the contents of three user-definable files automatically: acad.lsp, acaddoc.lsp, and the MNL file that accompanies your current customization file.īy default, the acad.lsp file is loaded only once, when the program starts, whereas acaddoc.lsp is loaded with each individual document (or drawing).
