System
The central connection between Netfabb and the executed Lua script is the system
object. As a global variable, it is accessible from anywhere in the script and is the starting point for the creation of all other objects such as meshes, XML files, or database connections.
Properties
Executable
[Desktop Automation]
Property | Read/write | Type | Description |
---|---|---|---|
buildnumber | read-only | string | Build number (eg. 124) |
corecount | read-only | number | Number of processor cores |
exitcode | read-only | number | Exit code |
isquiet | read-only | Boolean | returns if the logging to stdout is disabled |
linebreak | read-only | string | Line-break characters |
majorversion | read-only | number | returns the major version of Netfabb (eg. 15) |
minorversion | read-only | number | returns the minor version of Netfabb (eg. 0) |
officialversion | read-only | string | Returns the official number version (eg. 2024) |
paramcount | read-only | number | returns the number of command-line parameters |
result | read-only | Mesh | Resulting Mesh object |
timer | read-only | number | returns the number of milliseconds since the Lua script has started |
versionstring | read-only | String | returns the version string of the system (e.g. 15.0.0 64bit ) |
unixtime | read-only | number | returns the current time as Unix timestamp |
UI
[Desktop Automation]
Property | Read/write | Type | Description |
---|---|---|---|
areaunitfactor | read-only | number | Returns the conversion factor of the currently set area unit to the internal area unit (cm2): 100 or 25.4×25.4 |
areaunitstring | read-only | String | Returns the string representing the currently set area unit: cm2 or in2 |
lengthunitfactor | read-only | number | Returns the conversion factor of the current set length unit to the internal length unit (mm): 1 or 25.4 |
lengthunitstring | read-only | String | Returns the string representing the currently set length unit: mm or in |
volumeunitfactor | read-only | number | Returns the conversion factor of the current set volume unit to the internal volume unit (cm3): 1000 or 25.4×25.4×25.4 |
volumeunitstring | read-only | String | Returns the string representing the currently set volume unit: cm3 or in3 |
fontsize | read-only | number | Returns the current font-size of the application |
screenwidth | read-only | number | width of the screen in pixels |
screenheight | read-only | number | height of the screen in pixels |
Constants
Name | Type | Literal | Description |
---|---|---|---|
cameraBack | String | orientation_back | "system:setcameraorientation" constant for the Back perspective |
cameraBottom | String | orientation_bottom | "system:setcameraorientation" constant for the Bottom perspective |
cameraFront | String | orientation_front | "system:setcameraorientation" constant for the Front perspective |
cameraIso | String | orientation_iso | "system:setcameraorientation" constant for the Isometric perspective |
cameraLeft | String | orientation_left | "system:setcameraorientation" constant for the Left perspective |
cameraRight | String | orientation_right | "system:setcameraorientation" constant for the Right perspective |
cameraTop | String | orientation_top | "system:setcameraorientation" constant for the Top perspective |
stCLI | Number | 1 | "sliceobject:savetofile" type parameter for CLI slice files |
stCLS | Number | 3 | "sliceobject:savetofile" type parameter for CLS slice files |
stSLC | Number | 4 | "sliceobject:savetofile" type parameter for SLC slice files |
stSLI | Number | 2 | "sliceobject:savetofile" type parameter for SLI slice files |
stUSF | Number | 0 | "sliceobject:savetofile" type parameter for USF slice files |
zoomtoAllparts | Number | 0 | "system:zoomto" constant for focusing on the bounding box of all visible parts in the current buildroom combined, excluding the buildroom volume |
zoomtoEverything | Number | 3 | "system:zoomto" constant for focusing on the bounding box of all visible parts in the current buildroom and the buildroom volume combined |
zoomtoHome | Number | 7 | Functionally equivalent to zoomtoEverything |
zoomtoPlatform | Number | 2 | "system:zoomto" constant for focusing on the bounding box of the buildroom only |
zoomtoSelected | Number | 1 | "system:zoomto" constant for focusing on the bounding box of selected and visible parts combined. If none are selected, or all selected parts are set to invisible, focuses on the bounding box of all parts, visible or not. |
Methods
For the methods of the system
object consult the dedicated articles linked below.