The PathConfig struct provides methods to access and manage Project paths, System paths, manipulate paths and convert between UNC, absolute and relative paths and so on.
Available in 3ds Max 9 and higher.
pathConfig.doProjectSetupSteps()
Performs all steps necessary to set up a new Project, including browsing for project folder and creating all sub-folders. Returns true on success, false if cancelled.
pathConfig.doProjectSetupStepsUsingDirectory <ProjectPath>
Performs all steps necessary to set up a new Project using the supplied Project Path as the Root. Returns true on success, false if cancelled.
pathConfig.doSetProjectFolderSteps()
Performs all steps necessary to set an existing Project, including browsing for project folder. Returns true on success, false if cancelled.
pathConfig.doProjectSetupStepsUsingDirectory <ProjectPath>
Performs all steps necessary to set an existing Project using the supplied Project Path as the Root. Returns true on success, false if cancelled.
pathConfig.getCurrentProjectFolder()
Returns the current Project Folder.
pathConfig.getCurrentProjectFolderPath()
Returns the current Project Folder definition file (*.MXP).
pathConfig.getProjectFolderPath <ProjectPath>
Returns the Project Definition filename (
Returns the indexed Project sub-directory. FOR EXAMPLE, ``` --Print all Project Sub-Directories: for i = 1 to pathConfig.getProjectSubDirectoryCount() do format "%: %\n" i (pathConfig.getProjectSubDirectoryi) ``` Returns the number of Project sub-directories. See above example. Adds Project Directory Filter where <directory_type> is one of the following: Removes the specified Project Directory Filter where <directory_type> is one of those listed for addProjectDirectoryCreateFilter(). Removes all filters added using pathConfig.addProjectDirectoryCreateFilter() Returns an array of the currently set Project Directory Filters. Sets the current project folder to the given path. The Project Folder is displayed in the title bar of 3ds Max and will be updated instantly. Appends the second argument filename to the first argument path, adding backslash if necessary. FOR EXAMPLE, ``` pathConfig.appendPath "c:\temp" "test.txt" "c:\temp\test.txt" pathConfig.appendPath "c:\temp\" "test" "c:\temp\test" ``` Converts the relative path argument to absolute project path using the Project Directory. FOR EXAMPLE, ``` pathConfig.convertPathToAbsolute "meshes" "C:\Documents and Settings\username\My Documents\3dsmax\meshes" ``` Converts the path argument to lower case and unifies the backslashes. FOR EXAMPLE, ``` pathConfig.convertPathToLowerCase "C:\Temp\Test/pATH" "c:\temp\test\path" ``` Converts the first path argument to a relative path with respect to the second path argument. FOR EXAMPLE, ``` pathConfig.convertPathToRelativeTo "C:\Temp\Test" "c:\Program Files\" "..\Temp\Test" ``` Returns the UNC path from a mapped drive path. FOR EXAMPLE, ``` --If drive letter T: is mapped to a server called MyServer, then pathConfig.convertPathToUnc "t:\project" "\MyServer\projects" ``` Resolves the filename using map paths, returns fully qualified filename if the file is found. Returns a normalized path name. FOR EXAMPLE, ``` pathConfig.normalizePath "scenes/test.txt" ".\scenes\test.txt" ``` Returns true if the two paths resolve to the same location (in other words the two paths are equivalent), false if they are not equivalent. FOR EXAMPLE, ``` pathConfig.pathsResolveEquivalent "scenes\test.txt" "./scenes/test.txt" true ``` Resolves the path symbols. This is the property toggle found in Preferences>Files which controls whether max automatically converts absolute paths to their UNC equivalents. (i.e. M:\file.txt to server1\\file.txt if M: is mapped to server1\) Removes a leaf from the given path. FOR EXAMPLE, ``` pathConfig.removePathLeaf "c:\temp\test" "c:\temp" ``` Removes the top parent from the given path. FOR EXAMPLE, ``` pathConfig.removePathTopParent "c:\temp\test" "temp\test" ``` Returns the last sub-directory name from the given path. If the path is a full file name, returns the file name. Equivalent to filename from path. EXAMPLES: ``` pathConfig.stripPathToLeaf "C:\temp\test" "test" pathConfig.stripPathToLeaf "C:\temp\test\" "" pathConfig.stripPathToLeaf "C:\temp\test\somefile.tga" "somefile.tga" --COMPARE: filenamefrompath "C:\temp\test" "test" filenamefrompath "C:\temp\test\" "" filenamefrompath "C:\temp\test\somefile.tga" "somefile.tga" ``` Returns the root of the given path. EXAMPLES: ``` pathConfig.stripPathToTopParent "C:\temp\test\test.tga" "C:" pathConfig.stripPathToTopParent "\\SomeServer\Projects\Test" "\SomeServer" ``` Returns true if the argument is an absolute path, false if it is a relative path. The path does not have to exist for this method to operate on it. Returns true if the argument is a legal path definition, false if it is an illegal path. The path does not have to exist for this method to operate on it, it is only being parsed for correctness. EXAMPLES: ``` pathConfig.isLegalPath "c:\" --legal path, existing true pathConfig.isLegalPath "z:\path" --legal path, not existing true pathConfig.isLegalPath "zz:\path" --illegal double drive letter! false ``` Returns true if the argument starts with a backslash, false if it does not. EXAMPLES: ``` --starts with backslash: pathConfig.isPathRootedAtBackslash "\machine\c$" true --does not start with backslash: pathConfig.isPathRootedAtBackslash "c:\temp" false ``` Returns false if the argument starts with a backslash, true if it starts with a drive letter. The inverse of pathConfig.isPathRootedAtBackslash() Returns true if the argument path is a valid Project Folder root, false otherwise. Returns true if the argument path is a Root path, false otherwise EXAMPLES: ``` pathConfig.isRootPath "C:\" true pathConfig.isRootPath "C:\temp" false ``` Returns true if the argument path is a UNC path, false otherwise EXAMPLES: ``` pathConfig.isUncPath "T:\Projects" --mapped drive, not UNC false pathConfig.isUncPath "\\MyServer\Projects" --UNC path true ``` Returns true if the argument path is a UNC share path, false otherwise. Returns true if the system is using Profile directories, false otherwise. Returns true if the system is using Roaming Profiles, false otherwise. When using roaming profiles on somebody else's machine, your profile is being accessed over the network from your own machine. This mode is not officially supported. Returns true if the path is absolute and points to a file or directory that currently exists. This function checks if a file or directory exists in the location pointed to by the absolute filename_string, potentially considering the MissingPathCache. See the MissingPathCache for more information. Note that the disk is accessed to check for its existence, so checking paths (especially on network drives) may incur a performance cost. If ignoreCache is specified as true, testing does not consider whether the file's path may be in the File Path Not Present Cache maintained by the MissingPathCache. Points at the GetDir() method documented here. Returns the system directory where directory_type is one of the following: Points at the mapPaths struct definition. EXAMPLE ``` --the two method calls are equivalent: mapPaths.getFullFilePath "fir.tga" pathConfig.mapPaths.getFullFilePath "fir.tga" ``` Points at the pluginPaths struct. EXAMPLE ``` count = pathConfig.pluginPaths.count() for j = 1 to count do format " % : %\n" j (pathConfig.pluginPaths.get j) ``` Points at the sessionPaths struct. Points at the SetDir() method documented here. Points at theXRefPath struct EXAMPLE ``` --the two method calls are equivalent: xrefPaths.getFullFilePath "delme.max" pathConfig.xrefPaths.getFullFilePath "delme.max" ``` Saves the path configuration to the given filename.Returns true on success, false otherwise.Corresponds to the Save To... button in the Customize>Configure User Paths dialog. Loads the path configuration from the specified path configuration file. Returns true on success, false otherwise.Corresponds to the Load button in the Customize>Configure User Paths dialog. Merges the settings from the given path configuration file. Returns true on success, false otherwise. Loads the path configuration from the specified path configuration file. Returns true on success, false otherwise. Corresponds to the Merge button in the Customize>Configure User Paths dialog.pathConfig.getProjectSubDirectory <subdir_index>
pathConfig.getProjectSubDirectoryCount()
pathConfig.addProjectDirectoryCreateFilter <#directory_type>
#font | #Scene | #export | #import | #help | #expression | #preview | #image | #Sound | #plugcfg | #maxstart | #vpost | #drivers | #autoback | #matlib | #scripts | #startupScripts | #defaults | #renderPresets | #ui | #maxroot | #renderoutput | #animations | #archives | #Photometric | #renderassets | #userScripts | #userMacros | #userStartupScripts | #temp | #userIcons | #maxData | #downloads | #proxies
pathConfig.removeProjectDirectoryCreateFilter <#directory_type>
pathConfig.removeAllProjectDirectoryCreateFilters()
pathConfig.getProjectDirectoryCreateFilters()
pathConfig.setCurrentProjectFolder <ProjectPath>
pathConfig.appendPath <path1> <path2>
pathConfig.convertPathToAbsolute <relative_path>
pathConfig.convertPathToLowerCase <path>
pathConfig.convertPathToRelativeTo <path1> <path2>
pathConfig.convertPathToUnc <path>
mapPaths.getFullFilePath <filename>
pathConfig.normalizePath <path>
pathConfig.pathsResolveEquivalent <path1> <path2>
pathConfig.resolvePathSymbols <path>
pathConfig.resolveUNC SystemGlobal:resolveUNC false
pathConfig.removePathLeaf <path>
pathConfig.removePathTopParent <path>
pathConfig.stripPathToLeaf <path_or_filename>
pathConfig.stripPathToTopParent
pathConfig.isAbsolutePath <path_string>
pathConfig.isLegalPath <path_string>
pathConfig.isPathRootedAtBackslash <path>
pathConfig.isPathRootedAtDriveLetter <path>
pathConfig.isProjectFolder<path>
pathConfig.isRootPath <path>
pathConfig.isUncPath <path>
pathConfig.isUncSharePath <path>
pathConfig.isUsingProfileDirectories()
pathConfig.isUsingRoamingProfiles()
pathConfig.doesFileExist <filename_string> ignoreCache:<boolean>
pathConfig.GetDir <#directory_type>
#font | #Scene | #export | #import | #help | #expression | #preview | #image | #Sound | #plugcfg | #maxstart | #vpost | #drivers | #autoback | #matlib | #scripts | #startupScripts | #defaults | #renderPresets | #ui | #maxroot | #renderoutput | #animations | #archives | #Photometric | #renderassets | #userScripts | #userMacros | #userStartupScripts | #temp | #userIcons | #maxData | #downloads | #proxies | #pageFile
pathConfig.mapPaths #Struct:mapPaths
pathConfig.pluginPaths #Struct:pluginPaths
pathConfig.sessionPaths #Struct:sessionPaths
pathConfig.SetDir
pathConfig.xrefPaths #Struct:xrefPaths
pathConfig.SaveTo <filename>
pathConfig.load <filename>
pathConfig.merge <filename>