Instruction on the usage of AutoCAD's acaddoc.lsp
(It works for other versions (2000 and later) of AutoCAD and verticals as well)
AutoCAD is normally not supplied with the user-defined startup file acaddoc.lsp; you create (Notepad can be used) and maintain the file yourself.
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 for the ACADLSPASDOC and LISPINIT system variables.
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.
Warning! Do not modify the reserved startup file acadYEARdoc.lsp (acad2000doc.lsp, acad2000idoc.lsp, acad2002doc.lsp, acad2004doc.lsp, acad2005doc.lsp, acad2006doc.lsp, acad2007doc.lsp, acad2008doc.lsp, acad2009doc.lsp, acad2010doc.lsp, acad2011doc.lsp, acad2012doc.lsp, acad2013doc.lsp, acad2014doc.lsp, acad2015doc.lsp). Autodesk provides the acadYEARdoc.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.
Do not modify the reserved file acadYEARdoc.lsp; it contains AutoLISP-defined functions required by AutoCAD. The file acadYEARdoc.lsp is loaded into memory immediately before acaddoc.lsp.
How to create acaddoc.lsp if it does not exist
In the folder where you want to save acaddoc.lsp right click and select New>Text Document. Change the name to acaddoc.lsp. Now you should be able to double click on the file and typically edit it in Notepad.
Or start Notepad, edit, save, ready.
Examples on location for acaddoc.lsp
C:\Program Files\AutoCAD 2008\Support
C:\Documents and Settings\<loginname>\Application Data\Autodesk\AutoCAD 2008\R17.1\enu\Support
or in Windows Vista
If you want to find folders that are searched by AutoCAD run the OPTIONS command and look at the Files tab and at the Support File Search Path.
Load order of files in AutoCAD
Files in acad.rx
Partials to Main CUI/CUIX named MNLs
Partials to Main CUI/CUIXloaded LSPs and MNLs in the order seen in CUI
Main CUI/CUIX named MNL
Main CUI/CUIX loaded LSP and MNL in the order seen in CUI
Partials to Enterprise CUI/CUIX named MNLs
Partials to Enterprise CUI/CUIX loaded LSPs and MNLs in the order seen in CUI
Enterprise CUI/CUIX named MNL
Enterprise CUI/CUIX loaded LSP and MNL in the order seen in CUI
Express Tools loaded LSP and MNL in the order seen in CUI
Files in the startup suite in listed order seen in APPLOAD
Script file started by acad.exe command line switch /b
This applies to AutoCAD 2000, AutoCAD 2000i, AutoCAD 2002, AutoCAD 2004, AutoCAD 2005, AutoCAD 2006, AutoCAD 2007, AutoCAD 2008, AutoCAD 2009, AutoCAD 2010, AutoCAD 2011, AutoCAD 2012, AutoCAD 2013, AutoCAD 2014, AutoCAD 2015
Update related to AutoCAD 2013 SP1: AutoLISP and VBA Security Controls in AutoCAD 2013 SP1. New /nolisp Startup Switch. LISPENABLED, AUTOLOAD, AUTOLOADPATH system variable added.
The acad2013.lsp and acad2013doc.lsp files will now be loaded only from their default installation folders:
- 2015-05-26 JTB Steel 1.2.1 steel shape drafting app for AutoCAD released
- 2015-04-21 Spiro1.2 released
- 2015-04-14 JTB CAD Automation Tools 4.2 released. Batch create and update drawings. For example change title block text on hundreds of drawings automatically.
- 2015-04-14 JTB Sheet Set Creator 1.3 released
- 2015-04-13 JTB Align Plus 3.5 app for AutoCAD released
- 2015-04-13 JTB Text Bubble Plus 2.1 and Text Bubble 2.5 released
- 2015-04-13 SmartPurger 3.6 released. Script and batch processing for AutoCAD
- 2015-04-13 Palette Auto-hide Speed 1.4 released. Translated tooltips for AutoCAD.
- 2015-04-13 TransTips 1.2 released. Translated tooltips for AutoCAD.
- 2015-04-12 JTB FlexReport 9.2 released. Time to upgrade or request a free fully functional trial. Your network license assessment companion.
- 2015-04-12 JTB FlexReport LT 1.2 released
- 2015-03-20 OffsetInXref 1.2 released. Better Offset for AutoCAD.
- 2015-03-20 OsnapzBG 1.2 released
- 2015-03-20 License Borrowed Dialog Closer 1.0.1 released
- 2015-03-20 Catenary for AutoCAD 1.0 released
- 2015-03-20 DwgNotes for AutoCAD 1.2 released
- 2015-03-20 DwgInfoTip 1.4 released
- 2015-03-20 DimNotes for AutoCAD 1.3 released
- 2015-03-20 DimensionPatrol 1.3 released. Highlight edited dimensions for AutoCAD.
- 2015-03-20 DigSigStamp for AutoCAD 1.3 released
- 2015-03-20 Batch Publish for AutoCAD 2.0 released. Mass produce PDF and/or DWF.
- 2015-03-20 JTB Change Title 1.0 for AutoCAD released
- 2015-03-18 SSMPropEditor 5.2 released. Makes it easy to edit properties on multiple sheets in AutoCAD Sheet Set Manager. Request a free fully functional trial.
- 2015-03-16 JTB Current Folder 1.2 for AutoCAD released
- 2014-12-21 Engco for rebar detailing released
- 2013-04-09 UnitCAD for AutoCAD, plug-in for AutoCAD automation with parameters
- 2013-02-12 HTools AutoCAD productivity tools