Lua Scripts
Lua is a scripting language. Advanced users can use Lua to create custom scripts for complex mapping configurations. Most users will not need this functionality, but it is provided for power users who are comfortable creating scripts. You can create scripts to map the individual EasyPower fields, but scripted functions can be also shared.
Shared Lua Functions
Shared Lua functions are special in that they can be called when mapping Lua scripts in the script mapping dialog boxes. It enables you to create reusable scripts so you don't have to duplicate the script for each mapping where it is used.
Figure 1: Shared Lua Functions
Creating Lua Scripts
If you want to create scripts for the individual EasyPower fields, you can do this when mapping data for the EasyPower import by selecting Lua script in the Map Revit Data to EasyPower column, and then clicking Edit Script.
Figure 2: Lua Script Options
This opens a window where you can create a mapping script. Click Run with selected data to preview the script results for the selected equipment.
Figure 3: Editing the Mapping Script Settings
If you want to use a shared Lua script, you can include it. The script shown below pulls in the shared Lua script shown earlier to calculate the transformer Rating kVA field.
Figure 4: Using a Shared Lua Function in a Lua Script
More Information
Mapping Revit to EasyPower | Panel Row Mappings |