About File Organization

The default folder structure for program and support files is designed to efficiently organize those files into logical groups.

If the default organization of program and support files does not suit your needs, you can change it. However, some applications look for certain files in specific locations, and you should verify that modifications do not conflict with the requirements of those applications. Without the full path, including drive and folder, the program can locate only those files that are found in its library search paths.

The program references the user profile of the operating system to identify where local and roamable customizable files should be stored. The locations of the local and roamable folders can be accessed using the following system variables:

Beginning with AutoCAD 2013 SP1-based products on Windows and AutoCAD 2014 for Mac, the reserved acad<release_number>.lsp and acad<release_number>doc.lsp files and their successors are loaded only from the product's default installation folders. Depending on the setting of the SECURELOAD system variable, the TRUSTEDPATHS system variable specifies the folders from where AutoCAD-based products can load and execute other files that contain code. In addition, the LEGACYCODESEARCH system variable controls whether the Start In folder will be searched for executable files.

Note: AutoLISP applications are not supported by AutoCAD LT.

The following AutoLISP sample code defines the CUSTFILES command, and opens File Explorer to the location where roamable customizable files were installed.

Note: The SHELL command is available on Windows only and AutoLISP is not available in AutoCAD LT.
(defun c:custfiles ()
  (command "shell" 
    (strcat "explorer \"" (getvar "roamablerootprefix") "\"")
  )
 (princ)
)

Library Search Path

The library search path specifies where the program searches for files when you do not specify a full path name, as follows:

Depending on the current environment, two or more folders may be the same.

Important: Beginning with AutoCAD 2016-based products, the LEGACYCODESEARCH system variable controls whether the Start In and Drawing folders will be searched for executable files. Because the Start In and drawing folders are often targets for malware, it is recommended that you leave LEGACYCODESEARCH set to 0, off.

If a file is not in this search path, you must specify its full or its relative path name and file name before the program can find it. For example, if you want to insert the part5.dwg file into your current drawing and it is not in the library search path, you must specify its full path name or a relative path name based on a valid path in the library search path. A relative path name is shown here:

Command: -insert

Enter block name or [?]: /files2/olddwgs/part5

Folder Structure

The program uses tree-structured folders and subfolders. It is recommended that you keep supplemental files, such as AutoLISP applications (not in AutoCAD LT), customization files, or third-party applications, separate from the installed program and support files. This makes it easier to track possible conflicts and to upgrade each application without affecting the others.

The default location for the program is in the Program Files folder on Windows and Applications on Mac OS. You can create a new folder on the same level (for example, /AcadApps) and store custom programs, customization files, and other third-party applications in subfolders on the next level. If you want to maintain multiple drawing folders (for separate job files), you can create a folder such as /AcadJobs with subfolders for each job.

Command Search Procedure

When you enter a command, the application goes through a series of steps to evaluate the validity of the command name. A command can be

Note: AutoLISP, ObjectARX, and Managed .NET applications are not supported by AutoCAD LT. Managed .NET applications are not supported on Mac OS.

You can enter a command at the Command prompt or start it from the user interface. Commands can also be started from a script file or by an AutoLISP, ObjectARX, or Managed .NET application.

The following list describes the search order to validate a command name.

  1. If the input is a null response (Spacebar or Enter), the program uses the name of the last command issued. HELP is the default.
  2. The command is checked against the list of built-in commands. If the command is in the list and is not preceded by a period (.), the program then checks the command against a list of undefined commands. If the command is undefined, the search continues. Otherwise, the command is run, unless another reason prevents it from doing so. Running it transparently or in Perspective mode might be impossible.
  3. The command is checked against the names of commands defined by a device driver, and then by those defined by the display driver.
  4. The command is checked against the external commands defined in the program parameters file. If the command name corresponds to a defined external command, that command runs, and the search is complete.
  5. The command is checked against the list of commands defined by AutoLISP, ObjectARX, and Managed .NET applications. At this point, an autoloaded command is loaded. (Not available in AutoCAD LT)
  6. The program checks the command name against the list of system variables. If the command name is in the list, the SETVAR command is executed, using the input as the variable name.
  7. If the command name corresponds to a command alias, AutoCorrect name, or synonym defined in their associated program parameters files, the expanded command name is used and the search process starts over with the list of built-in commands.
  8. If all the preceding steps fail, the search terminates with a warning message about illegal command names.