Welcome to the Lua plug-in for BobCAD-CAM Help System
BobCAD-CAM software now supports Lua scripting functionality in order to create entities in the CAD workspace by use of scripting. The following functionality is supported at this time:
- Loading and unloading Lua scripts
- Adding ribbon tabs
- Adding commands to the ribbon
- Creating dialog boxes with common controls
- Displaying message boxes
- Creating and deleting entities in the active document
- Managing the undo list
- Getting selected entities from the active document
- Getting layer and UCS information from the active document
- and many more useful CAD and CAM related utilities.
The technology used in the BobCAD-CAM product lines are a Lua interpreter from MoonSharp.org which is a Lua interpreter written specifically for C# for maximum compatibility with .NET and based off of the Lua 5.2 language.
Resources and API lists can be found from MoonSharp.org as well as Lua 5.2 Reference Manual. This help system is in no way intended to teach the rules, syntax, or anything related to general Lua programming knowledge or best practices. The reference manual linked in this topic is an excellent starting resource for learning the Lua language.
Debugging the Lua code is also made possible thanks to MoonSharp.org by utilizing the extension built for VS Code. More information on setting up a debugging environment can be found in the Debugging topics of this help system.
For learning Lua or testing any source code, multiple IDE’s exist, but the one I have found to be simple and useful is the SciTE Lua for Windows IDE for testing coding and debugging.
The download for this can be found here: SciTE Lua for Windows
NOTE: The above mentioned IDE is not required at all to do anything with BobCAD-CAM products, it is merely a suggestion if you would like to be able to learn using debugging tools from an IDE.
We highly suggest utilizing Visual Studio Code from Microsoft as your code editor due to the debugging capabilities.
Jump Right In!
If you just want to jump right in to getting your first plug-in going, please take a look at the Hello World Example to get started fast!