fbpx
The Power of ACADDOC.lsp in a Corporate Environment

Did you know there is one file that you can use in Autodesk AutoCAD and/or Civil 3D’s APPLOAD to control system variables and loaded lisp routines?

Using ACADDOC.lsp provides a quick and easy way to control system variables and available corporate lisp routines across your entire network!

Using your favorite text editor (I prefer Notepad++), copy and paste the following code into a blank document:

;; XYZ Corporation ACADDOC.lsp APPLOAD file

;; This is the only lisp routine needed inside of AutoCAD or Civil 3D’s APPLOAD Starup Suite

;; The XYZ-START lisp routine loads all of the corporate lisp routines, system variables, and commands

 

(defun C:XYZ-START ()

                (load “C:/LISPROUTINES/XYZ-START”) ;Set this to mapped network location

                (prompt “\nXYZ-START loaded”)

                (princ)(c:XYZ-START)

)

(LOAD “XYZ-START”);

 

(princ)

 

(SETVAR “CMDECHO” 0) ;Set this to 0 first so that the following commands aren’t shown in the command line

 

(SETVAR “ACADLSPASDOC” 1) ;Controls whether lisp is loaded for each drawing.

(SETVAR “STARTMODE” 0) ;Turns off the Start tab

(SETVAR “MENUBAR” 1) ;Turns on the menubar above the ribbon

 

(COMMAND “DISPLAYVIEWCUBEIN2D” “OFF”);Turns the view cube off

(COMMAND “NAVBAR” “OFF”) ;Turns the navigation bar off

(COMMAND “XREFLAYER” “C-XREF LAYER NAME”) ;Sets the default layer that XREF’s come in on (New variable that was introduced in 2018)

(COMMAND “LOGFILEMODE” “0”) ;Turns off the logging of all commands to a text file in My Documents folder

 

(princ)

Modify the file path under load to your corporate mapped drive and save this file as ACADDOC.lsp
Open a new blank drawing in your preferred text editor and paste the following code.

;; XYZ Corporation XYZ-START.lsp Lisp Routine file list

 

(defun C:TW       () (load “C:/LISPROUTINES/TW”)

                (prompt “\nTwist View loaded”)(princ)(c:TW))

(defun C:TWIST    () (load “C:/LISPROUTINES/TW”)

                (prompt “\nTwist View loaded”)(princ)(c:TW))

(defun C:UT       () (load “C:/LISPROUTINES/UNTWIST”)

                (prompt “\nUnTwist View loaded”)(princ)(c:UnTwist))

(defun C:UNTWIST  () (load “C:/LISPROUTINES/UNTWIST”)

                (prompt “\nUnTwist View loaded”)(princ)(c:UnTwist))

 

(princ)

(prompt “\nXYZ Lisp Routines Loaded”)

(princ)

This will work as starter code to modify for your corporate lisp routines.

After (defun C: type in the AutoCAD command to load the lisp routine.

Change load to point to your corporate mapped drive and the lisp routine you are loading.

After (princ) (c: type in the name of the lisp routine that you are loading

*Pro tip* – This example shows two lisp routines that can run by typing two different AutoCAD commands.

Save this file as XYZ-START.lsp.

Type APPLOAD in your command line.

Click on Contents in the bottom right under Startup Suite.

If you have a fresh install, this box will be empty. Click Add and load your custom ACADDOC.lsp.

The Startup Suite should now look like this with your custom ACADDOC.lsp. Click Close.

Your AutoCAD or Civil3D is now setup to load ACADDOC.lsp and XYZ-START.lsp from a network mapped drive.
The CAD manager or network administrator can easily modify these lisp routine files to load new system variables, commands, or lisp routines.

*Note* Each time AutoCAD or Civil3D opens a drawing, the ACADDOC.lsp will load because of (SETVAR “ACADLSPASDOC” 1) in ACADDOC.lsp. This is allows each AutoCAD or Civil3D to automatically reload ACADDOC.lsp and XYZ-START.lsp. AutoCAD or Civil3D only need to open a new drawing to reload these files.

Stay Connected

Get 24/7 access to top-notch technical content with new learning opportunities every week.

Contact Us

Newsletter