Debugging from a Post Processor
Debugging Lua scripts utilized inside a post processor is also possible using Visual Studio Code. However, there are a couple things you must know in order to have a nice easy setup.
- If you have not completed the Initial Setup process yet which Visual Studio Code, then please go complete that first!
- I recommend reviewing Beginning Debugging to get familiar with the process of starting the debugging and selecting your scripts if you have not already.
- Lastly the rest of the topic applies specifically to debugging when working with post processors.
Post Blocks
There are two main post blocks that are involved with debugging Lua scripts utilized by your post processor.
26. Set debug comments for post editing
debug_on
Debug must be turned on inside the post processor in order for BobCAD to activate the MoonSharp debug server from the software.
732. Lua sub folder? "FolderName"
If this block exists and has content, then the Lua files contained in the BobCAD-CAM Data\<product version>\Posts\Mill\<732 FolderName>\ directory will be utilized for debugging.
Otherwise the system will look for the *.lua file that is located in the same folder as the *.bcpst, that has the same name as the post processor.
For example:
BC_3x_Mill.BcPst and BC_3x_Mill.lua
For more information on the overall structure of the Lua scripting with your post processor please see the Post Processing topic