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.
Returns the number of processors (cores) available according to the operating system.
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.
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.
In versions prior to 3ds Max 2017, returned True if the Operating System is Windows98, Windows2000, Windows XP, Windows Vista or Windows 7.
In versions prior to 3ds Max 2017, returned True if the OS is a Win9x flavor.
Returns True if running in a Debugger.
systemTools.DebugPrint <string>
Prints the specified string to the debug output window of Visual Studio.
Available in 3ds Max 2011 and higher.
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.
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>
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 |
<bool>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.
<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 |
<bool> GenerateMiniDumpAndContinue sendDump:<false>
NEWin 3ds Max 2018 Update 2: Generate a MiniDump file and continue executing. If sendDump is true, the minidump file is sent to Autodesk.
The MiniDump file generated is located at C:\Users\<UserName>\AppData\Local\temp\3dsmax_minidump.dmp.
If a big MiniDump file is generated, it is located at C:\Users\<UserName>\AppData\Local\temp\3dsmax_minidump_big.dmp.
See also: "Using 3ds Max Generated Minidump Files" in the 3ds Max Developer Guide.
<bool> SetMiniDumpContents {#default | #basic | #medium | #full | <int>}
NEWin 3ds Max 2018 Update 2: 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>
NEWin 3ds Max 2018 Update 2: Sets the contents of generated big minidumps. Normally this is set to #off.
See also: "Using 3ds Max Generated Minidump Files" in the 3ds Max Developer Guide.
For internal use only:
<bool>systemTools.PB2_AllNoRefSafePointersTestingDisable <bool>disable
For internal use only.
<bool>systemTools.PB2_AllNoRefSafePointersTestingDisables()
For internal use only.
<bool>systemTools.allocateMemory()
For internal use only.
<bool>systemTools.releaseMemory()
For internal use only.