Applies to 2021.1 Update and later
Jump to:
Lua is Netfabb's method of choice to facilitate automation tasks inside the software, available in Netfabb Ultimate. One particular advantage is that, while not necessary, a Lua script may work on an entirely different project than currently loaded in Netfabb, if any.
Lua-automatable areas in Netfabb
For the Lua reference on 3S, see the relevant section in Latticing.
TopNetfabb supports generally the version 5.1 of the Lua language definition, see: http://www.lua.org/manual/5.1/
Of the Lua 5.1 standard, Netfabb supports the core language specification as well as selected libraries.
Lua Library |
Support |
Note |
---|---|---|
Base |
Yes, with exceptions |
Some exceptions:
|
Coroutine Manipulation |
Yes |
|
Modules |
No |
Use system:executescriptfile() |
String manipulation |
Yes |
|
Table manipulation |
Yes |
|
Mathematical Functions |
Yes |
|
Input and output Facilities |
No |
|
Operating System Facilities |
No |
|
Debug library |
No |
For Lua in the Netfabb default module, also referred to as desktop automation, a debugger GUI is available. |
The scripting reference lists all available objects, methods, and properties available in Netfabb's Lua implementation. It has its own section in the online help.
TopTo make Lua scripts available for execution within Netfabb they are stored in a library, that means loading them from files and storing them internally. The library resides in Netfabb's settings database. The library provides several functions:
The icon in the toolbar makes Lua scripts readily available.
Stepping through a script can help with identifying mistakes
Netfabb includes a number of example scripts that demonstrate how to address a variety of tasks with Lua. These can be found in the library as well as at Examples\LUA Scripts in the Netfabb installation directory. Some of them require some modification like changing paths to meet your particular installation and paths.
Noteworthy examples are the scripts DemoApplication and DemoWorkflows. Both are full applications written in Lua and run within Netfabb. They implement a selection from the example scripts and make them available via GUI to demonstrate not only the use of such scripts but also how to implement a GUI to collate such functions. They are two of the default scripts loaded in the library.
Top