Skip to content

Let’s Explore!

February 9, 2013

With SHELL, you can execute operating system (OS) commands while remaining in AutoCAD. Type SHELL at the command prompt and AutoCAD will prompt you for an OS command. When the command has been executed, SHELL launches the program in a new window. For example you can type Explorer (to launch windows explorer) or Notepad (to launch Notepad).

Although shell commands can be helpful I found it even better to add a little lisp to the equation. Typing Explorer at the command prompt brings you to a default directory on your local drive.  What I would like to do is type explorer and look at my project folder where my current drawings are located. This can be very helpful when trying to manage project data.

This handy little lisp routine (shown below) will bring up explorer to the current project directory you are in.

(defun c:expl ()
(startapp “explorer” (strcat “/n,/e,” (getvar “dwgprefix”)))

Copy or paste the code into notepad (or any text editor) and name it expl.lsp. Next type appload at the command prompt and place that lisp file in your startup suite (see image below). Of course you do not have to do that but it’s nice to have that command available at all times.


After you type expl you will be taken out to the current folder where your  drawing is located. For this example I have been taken out to the folder my projects where my drawing named My Project.dwg is located.


This is a great tool for managing project files and folders.  Let’s take this one step further. Have you ever wanted to go directly to the folder that contains your backup (.bak) files? Maybe after a crash or a change you need to go back. Using the same code simply change a variable to the autosave setting (savefilepath variable) as shown.  We will name this one exps.lsp

(defun c:exps ()
  (startapp “explorer” (strcat “/n,/e,” (getvar “savefilepath”)))

This command will take you out to the folder where you backup files are located. This folder location is stored in the options menu as shown.


You now have quick access to you project folders and you backup files. Put both in your startup suite and you will be much more efficient when working with project folders and backup files.

From → Autodesk, CAD Tips

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: