About Lua in Netfabb

Introduction

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 may be used in the following areas:

  1. Netfabb default module
  2. Slice Commander
  3. Selective Space Structures (3S)

For the Lua reference on 3S, please see the relevant section.

Lua Support Scope

Netfabb 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

Comment

Base

Yes, with exceptions

Some exceptions:
  • dofile: use system:executescriptfile()
  • print: use system:log() instead

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

The Debug library

No

Find the scripting reference here: https://knowledge.autodesk.com/support/netfabb/learn-explore/caas/simplecontent/content/autodesk-netfabb-lua-scripting-reference-0.html

Lua Script Library

Lua scripts in Netfabb are managed in a library, that means loading them from files and storing them internally; only then do they become available for execution within Netfabb.

Examples

Netfabb includes a number of example scripts that demonstrate how to address a variety of tasks with Lua. Most of these are not already loaded into the script library, but reside as files 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.

One noteworthy example is the demo application. It is a full application written in Lua and run within Netfabb. It implements a selection from the example scripts and makes them available via GUI to demonstrate not only the use of such scripts but also how to implement a GUI to collate such functions. As it is a Lua script, it must be loaded into the Lua Script Library just like other scripts.