Symbolic Pathnames

You can use symbolic pathnames in the form $<name> anywhere a filename can be supplied to MAXScript.

This support was added in 3ds Max 4 and was largely enhanced in 3ds Max 9.

Any filename you provide to MAXScript can begin with a '$' followed by one of the symbolic directory names below.

The following symbolic names are recognized:

Index Symbolic Name Directory
1 $max Main 3ds Max executable directory
2 $maps First directory in Maps directory config*
3 $scenes 3ds Max Scenes directory
4 $fonts Fonts directory
5 $imports File Imports directory
6 $exports File Exports directory
7 $sounds Sounds directory
8 $matlibs Material Libraries directory
9 $scripts Scripts directory
10 $startupScripts Auto-load startup scripts directory
11 $plugins First in the Plug-ins directory config*
12 $plugcfg Plugin configurations directory
13 $images Images directory
14 $ui User Interface files directory
15 $macroScripts macroScripts in UI directory
16 $web Web downloads directory
17 $temp System temp directory
18 $renderPresets Render presets directory
19 $help Help files directory
20 $expressions Expressions directory
21 $previews Previews directory
22 $maxstart Directory of MAXSTART.MAX
23 $vpost Video post directory
24 $drivers Drivers directory
25 $autoback Autobackup directory
26 $marketDefaults Market Defaults directory
27 $icons Icons directory
28 $maxSysIcons System icons directory
29 $renderOutput Render output directory
30 $animation Animations directory
31 $archives Archives directory
32 $photometrics Photometric files directory
33 $renderAssets Render Assets directory
34 $userScripts User Scripts directory
35 $userMacros User Macroscripts directory
36 $userStartupScripts User Startup Scripts directory
37 $userIcons User Icons directory
38 $maxData Max Data (Root) directory
39 $downloads Downloads directory
40 $proxies Bitmap Proxies directory
41 $assemblies Assemblies directory
42 $hardwareShadersCache Hardware shaders directory
43 $plugcfg_ln Plugcfg_ln directory
44 $ui_ln UI_LN directory
45 $autodeskcloud Autodesk cloud directory
46 $userStartupTemplates Startup templates directory
47 $privateExchangeStoreInstallPath Private Exchange Store install directory. Note: this is now an alias for $privatePluginPackageInstallPath, but is retained for backwards compatibility.
48 $publicExchangeStoreInstallPath Public Exchange Store install directory. Note: this is now an alias for $publicPluginPackageInstallPath, but is retained for backwards compatibility.
49 $systemImage System scene images directory
50 $systemPhotometric Photometric light definition (.ies) file directory
51 $systemSound System scene sound assets directory
52 $pageFile Temporary page file directory (in 3ds Max 2018.4 Update and later).
53 $fluidSimulations Fluid simulation file cache location (in 3ds Max 2020 Update and later).
54 $userSettings User settings location (in 3ds Max 2020 Update and later).
55 $userTools User settings for 3rd party tools (in 3ds Max 2020 Update and later).
56 $privatePluginPackageInstallPath Install location for private plugin bundle packages (in 3ds Max 2020 Update and later).
57 $publicPluginPackageInstallPath Install location for public plugin bundle packages (in 3ds Max 2020 Update and later).
58 $plugindata Plug-in data location
59 $presets Particle Flow presets location (in 3ds Max 2022 and later).

Please note that these are similar to the 3ds Max System Directories filetype_names which start with a "#"and are used as arguments to the GetDir() and SetDir() methods.

The following example will open the file "foo.ms" in the current 3ds Max Scripts directory.

EXAMPLE

fileIn "$scripts\foo.ms"

In 3ds Max 9 and higher , the $maps and $plugins symbolic pathnames can also specify an index. In this case, the indexed directory will be used.

EXAMPLE

"$maps[2]\\mybitmap.tga"

When no index is provided, the first map resp. plugins path will be used.

SymbolicPaths Struct

In 3ds Max 9 and higher, the SymbolicPaths struct provides methods to access existing and define new symbolic paths:

symbolicPaths.numPaths()

Returns the number of symbolic path names. This includes both system and user-defined path names

symbolicPaths.getPathName<index>

Returns the indexed symbolic path name.

EXAMPLE

for i =1 to symbolicPaths.numPaths() do
format "% : %\n" i (symbolicPaths.getPathName i)
symbolicPaths.isPathName <string>

Returns true if the string corresponds to a symbolic path name, false otherwise.

EXAMPLE

symbolicPaths.isPathName "$maps"
true
symbolicPaths.isPathName "$map"
false
symbolicPaths.getPathValue {<index> | <string>}

Returns the path associated with the specified symbolic path name (specified either by index or by name string).

EXAMPLE

symbolicPaths.getPathValue 2
"C:\Program Files\Autodesk\3ds Max 2012\maps"
symbolicPaths.getPathValue"$maps"
"C:\Program Files\Autodesk\3ds Max 2012\maps"
symbolicPaths.numUserPaths()

Returns the number of user-defined symbolic path names.

symbolicPaths.getUserPathName <index>

Returns the indexed user-defined symbolic path name.

symbolicPaths.isUserPathName <string>

Returns true if the string corresponds to a user-defined symbolic path name, false otherwise.

symbolicPaths.getUserPathValue {<index> | <string>}

Returns the path associated with the specified user-defined symbolic path name

symbolicPaths.setUserPathValue {<index> | <string>} <filepath>

Sets path associated with the specified user-defined symbolic path name

symbolicPaths.addUserPath <string> <filepath>

Adds user-defined symbolic path name and path

symbolicPaths.removeUserPath {<index> | <string>}

Removes user-defined symbolic path name

symbolicPaths.expandFileName <filename>

Returns expanded file nane

EXAMPLE

symbolicPaths.numUserPaths() --check foruser path- none by default
0
symbolicPaths.addUserPath "$test" "c:\\test" --define new user path
OK
symbolicPaths.numUserPaths() --check foruser path- there is one!
1
symbolicPaths.isUserPathName "$test" --is a user symbolic path?
true
--See if $temp is a user symbolic path.
--NOTE that $temp is aSYSTEMsymbolic path,
--but not aUSERsymbolic path:
symbolicPaths.isUserPathName "$temp"
false
symbolicPaths.getUserPathName 1 --get the name of the first path
"$test"
symbolicPaths.getUserPathValue 1 --get the first path
"c:\test"
symbolicPaths.getUserPathValue "$test" --get the path by name
"c:\test"
symbolicPaths.setUserPathValue "$test" "c:\\another\\path" --change
OK
symbolicPaths.getUserPathValue "$test" --see if itchangeg?
"c:\another\path"
symbolicPaths.expandFileName "$test\\somefile.txt" --expand a path
"c:\another\path\somefile.txt"
symbolicPaths.removeUserPath "$test" --remove the user path
OK
symbolicPaths.numUserPaths() --there are no user paths left
0