Lua Directory Structure
To begin, we must discuss where the Lua scripts should be located and how they can be loaded into the BobCAD application.
A folder named LuaPlugins should be located in your BobCAD-CAM Data\BobCAD-CAM V##\ folder which will house the Lua plug-ins that you create.
Inside of this directory you can create a folder for the name of your plugin.
NOTE: The name of the folder will be the name displayed in the Installed Lua Plug-ins dialog box which can be utilized to enable and reload your plug-ins.
This dialog can be found from the File tab of BobCAD-CAM as shown next:
As you can see here, I have two plug-ins currently located in my LuaPlugins folder as seen below:
Plug-in Directory Structure
The plug-in folder structure is essentially up the user creating the plugin, but there are a few fundamental rules that can be utilized:
- A folder named Image can be placed in this directory which will be automatically searched when adding commands to the ribbon for the PNG icon file name when the full path is not provided.
- The Image folder can contain 2 directories that are automatically searched for handling large and small icons by the names of 16x16 and 32x32
- A *.lua file containing the function ConnectToBCC() implemented will be the main script file executed by BobCAD-CAM. We recommend simply naming this file Main.lua although it can be named anything.
NOTE: Only one *.lua file should exist with the function ConnectToBCC() implemented.
Example: