System Tools

This group of functions lets you gather various pieces of information about the system 3ds Max is running on.

systemTools.NumberOfProcessors()   

Returns the number of processors (cores) available according to the operating system.

systemTools.GetScreenWidth [ removeUIScaling:<true> ]

Returns the screen width including multiple monitors the desktop might be extended to.

The optional removeUIScaling parameter indicates whether to remove scaling on high-DPI displays.

systemTools.GetScreenHeight [ removeUIScaling:<true> ]

Returns the screen height including multiple monitors the desktop might be extended to.

The optional removeUIScaling parameter indicates whether to remove scaling on high-DPI displays.

systemTools.IsWindows98or2000() 

In versions prior to 3ds Max 2017, returned True if the Operating System is Windows98, Windows2000, Windows XP, Windows Vista or Windows 7.

systemTools.IsWindows9x() 

In versions prior to 3ds Max 2017, returned True if the OS is a Win9x flavor.

systemTools.GetOSVersion() 

Returns the OS version as a three part array representing the major version, the minor version, and the build number. This function works for all versions of Windows that 3ds Max supports.

Available in 3ds Max 2019.1 Update and higher.

<boolean> systemTools.IsDebugging() 

Returns True if running in a Debugger.

<string> systemTools.GetBuildNumber() 

Returns string in the form "#.#.#.#" where the numbers are the major version, the update version, the hot fix number, and the build number. This is the same string displayed as Product Version for 3dsmax.exe in File Properties and at the top of the About 3ds Max dialog.

Available in 3ds Max 2018 and higher.

systemTools.DebugPrint <string> 

Prints the specified string to the debug output window of Visual Studio.

Available in 3ds Max 2011 and higher.

systemTools.sceneIODebugEnabled <boolean> 

Specifies whether scene IO debugging is enabled. If true, information on scene load is sent to the log system.

Available in 3ds Max 2018 and higher.

<boolean> systemTools.isDebugBuild 

Returns true if this is a debug build of 3ds Max, false otherwise.

Available in in 3ds Max 2019.2 Update and higher.

systemTools.getEnvVariable <string> 

Returns the contents of specified environment variable. If the specified environment variable does not exist, returns a value of undefined.

Available in 3ds Max 2008 and higher. Previously available in the Avguard Extensions.

EXAMPLE

   systemTools.getEnvVariable "PATH"
   "C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\backburner 2\;"
<boolean>systemTools.setEnvVariable <string> { <string> | undefined } 

Sets the contents of specified environment variable.

Returns True if the set occurred, False if not.

If the second argument is the value undefined, the environment variable is deleted.

Available in 3ds Max 2008 and higher. Previously available in the Avguard Extensions.

systemTools.getEnvVariables 

Available in in 3ds Max 2022.1 Update and later

Returns a list of all currently defined system environment variables in the form of an array of strings with the format "ENVAR=setting".

systemTools.GetRegistryKeyBase()

Returns the base product registry key in the form: "SOFTWARE\\\". The application uses this key as the base for storing registry settings.

Available in 3ds Max 2018 and higher.

For example:

systemTools.GetRegistryKeyBase()
--> "SOFTWARE\Autodesk\3dsMax\21.0"
<int>systemTools.getmaxstdio()

Returns the number of simultaneously open files permitted at the stdio level (i.e. via fopen).

Available in 3ds Max 2014 and higher.

<int>systemTools.setmaxstdio <int newmax>

Sets the maximum number of simultaneously open files at the stdio level (i.e. via fopen).

The valid range for the newmax argument is between 512 and 2048.

Returns the new maximum value if successful.

Currently, only increasing the value is allowed.

Returns -1 if attempting to reduce the maximum count.

This could be used for example to allow more Point Cache files to be read in parallel at the same time.

Available in 3ds Max 2014 and higher.

<int>systemTools.getSystemMetrics <int>

Calls the win32 GetSystemMetrics() function, passing in the specified value. The return value is the return value from GetSystemMetrics(). See the Win32 documentation for getSystemMetrics for parameter values. Available in in 3ds Max 2017 and higher.

EXAMPLE

   -- get client window width
   systemTools.getSystemMetrics 16
   -->1920
<boolean>systemTools.isAeroEnabled()

Returns True if the Windows Aero theme is enabled, False if using the Windows Classic theme on Windows 7. Available in in 3ds Max 2017 and higher.

<boolean>systemTools.IsGpuPresent()

Returns true if at least one GPU is present on the current system, false otherwise.

Available in in 3ds Max 2018 and higher.

<array>systemTools.EnumDisplayDevices [ removeUIScaling:<true> ]

Returns an array of arrays, where each element in the outer array corresponds to a display device. For each display device, the array contains the device ID, the device name, the device string, the device state flags, and the device key. If the device is attached to the desktop, the array also contains the device's top left x and y pixel coordinates and its width and height. The pixel coordinates are 0-based. Available in in 3ds Max 2017 and higher.

See MSDN documentation of EnumDisplayDevices for more information on display devices.

EXAMPLE

   devices= systemTools.EnumDisplayDevices removeUIScaling:true
        for d in devices do print d #nomap
        #("\\.\DISPLAY1", "NVIDIA Quadro FX 4800", 5, "PCI\VEN_10DE&DEV_05FE&SUBSYS_059410DE&REV_A1", "\Registry\Machine\System\CurrentControlSet\Control\Video{8A328D59-1288-485D-821D-7DA906E41335}\0000", 0, 0, 1920, 1080)
        #("\\.\DISPLAY2", "NVIDIA Quadro FX 4800", 1, "PCI\VEN_10DE&DEV_05FE&SUBSYS_059410DE&REV_A1", "\Registry\Machine\System\CurrentControlSet\Control\Video{8A328D59-1288-485D-821D-7DA906E41335}\0001", 1920, 0, 1920, 1080)
        #("\\.\DISPLAYV1", "RDPDD Chained DD", 2097160, "", "\Registry\Machine\System\CurrentControlSet\Control\Video{DEB039CC-B704-4F53-B43E-9DD4432FA2E9}\0000")
        #("\\.\DISPLAYV2", "RDP Encoder Mirror Driver", 2097160, "", "\Registry\Machine\System\CurrentControlSet\Control\Video{42cf9257-1d96-4c9d-87f3-0d8e74595f78}\0000")
        #("\\.\DISPLAYV3", "RDP Reflector Display Driver", 2097160, "", "\Registry\Machine\System\CurrentControlSet\Control\Video{b043b95c-5670-4f10-b934-8ed0c8eb59a8}\0000")
        OK
<boolean> GenerateMiniDumpAndContinue sendDump:<false> 

Available in 3ds Max 2018.2 Update and higher: Generate a MiniDump file and continue executing. If sendDump is true, the minidump file is sent to Autodesk.

Note: This method, and in particular the sendDump argument is primarily for testing of minidump generation, and should not generally be used.

The MiniDump file generated is located at C:\Users\\AppData\Local\temp\3dsmax_minidump.dmp.

If a big MiniDump file is generated, it is located at C:\Users\\AppData\Local\temp\3dsmax_minidump_big.dmp.

See also: "Using 3ds Max Generated Minidump Files" in the 3ds Max Developer Guide.

<boolean> SetMiniDumpContents {#default | #basic | #medium | #full | <int>}

Available in 3ds Max 2018.2 Update and higher: Sets the contents of generated minidumps. The #default and #medium flags are equivalent.

The MiniDump flags set for each level are as follows (see link below for description of the MiniDump flag values) :

If <int> is specified, the bits set correspond to the MiniDump flag values.

See also: "Using 3ds Max Generated Minidump Files" in the 3ds Max Developer Guide.

systemTools.SetBigMiniDumpContents {#default | #basic | #medium | #full | #off | <int>

Available in 3ds Max 2018.2 Update and higher: Sets the contents of generated big minidumps. Normally this is set to #off.

Note: Big minidump files at #full setting can be quite large, sometimes more than 2GB. Use with caution.

See also: "Using 3ds Max Generated Minidump Files" in the 3ds Max Developer Guide.

For internal use only:

<boolean>systemTools.PB2_AllNoRefSafePointersTestingDisable <boolean>disable

For internal use only.

<boolean>systemTools.PB2_AllNoRefSafePointersTestingDisables()

For internal use only.

<boolean>systemTools.allocateMemory()

For internal use only.

<boolean>systemTools.releaseMemory()

For internal use only.