System Tools

The global struct called systemTools was added to MAXScript in 3ds Max 4 and was extended in 3ds Max 2008 and 3ds Max 2014.

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 applyUIScaling:<true>

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

The applyUIScaling parameter, when set to true, applies any scaling required on HDPI displays.

   

systemTools.GetScreenHeight applyUIScaling:<true>

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

The applyUIScaling parameter, when set to true, applies any scaling required on HDPI displays.

   

systemTools.IsWindows98or2000() 

Removed in 3ds Max 2017.

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() 

Removed in 3ds Max 2017.

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

   

systemTools.IsDebugging() 

Returns True if running in a Debugger.

   

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\;"

   

<bool>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.

   

<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>

NEW in 3ds Max 2017: 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.

EXAMPLE

-- get client window width
systemTools.getSystemMetrics 16
-->1920

   

<bool>systemTools.isAeroEnabled()

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

   

<array>systemTools.EnumDisplayDevices removeUIScaling:<true>

NEW in 3ds Max 2017: 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.

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
<bool>systemTools.PB2_AllNoRefSafePointersTestingDisable <bool>disable

NEW in 3ds Max 2017: For internal use only.

   

<bool>systemTools.PB2_AllNoRefSafePointersTestingDisables()

NEW in 3ds Max 2017: For internal use only.

   

<bool>systemTools.allocateMemory()

NEW in 3ds Max 2017: For internal use only.

   

See Also