Working with System Directories

3ds Max has many system directories defined where it reads and writes data from the filesystem. These directories are defined in the 3ds Max UI under Customize > Configure User and System Paths, but can also be accessed from pymxs.

System directories can be accessed in two ways: a filetype name, which is a MAXScript name value, such as #maxSysIcons, and a symbolic pathname string, which a convenient way to build file paths for functions like filein(). Symbolic pathnames are managed with functions in the symbolicPaths struct.

For example, to list all the symbolic pathnames and their values:

from pymxs import runtime as rt 

for i in range (1, rt.symbolicPaths.numPaths() + 1):
    symbolic_path = rt.symbolicPaths.getPathName(i)
    symbolic_value = rt.symbolicPaths.getPathValue(i)
    print('symbolic name: {} \t  value: {}'.format(symbolic_path, symbolic_value))

# We can also query System Directory names:
sys_icon_path = rt.pathConfig.getDir(rt.name('maxSysIcons'))
print('system icons: {}'.format(sys_icon_path))

The "3ds Max System Directories" topic group in the MAXScript Help contains more information, such as a list of all symbolic pathnames and file types, as well as other useful collections of path definitions such as mapPaths, xrefPaths, and additional path-related functions contained in pathConfig.