I've done this before. It isn't hard. Just click "edit process settings", and then go to the G-Code tab. You will need to enable the "Include M101/M102/M103 commands" options. When you do this, the software will now place an M101 right before the printer would start extruding, an M102 before any retractions, and an M103 before the extruder turns off. You can use those commands to trigger the laser too. But since these M101/M102/M103 commands are based on retractions, I would also make sure that retraction is enabled on the Extruders tab, and then go to the Advanced tab and disable "only retract when crossing open spaces". This way you will always have a retraction (and thus the M101/M102/M103 commands) anytime the extruder is moving to a new location.
Now, we just need to convert the M101/M102/M103 commands into what your laser actually uses. So go to the Scripts tab and add the following commands to your "additional commands for post processing" section.
Code: Select all
{STRIP "M106"}
{STRIP "M107"}
{REPLACE "M101" "M106"}
{STRIP "M102"}
{REPLACE "M103" "M107"}
That will remove any fan commands that were in the file to begin with (since those also use M106/M107), and then it will replace each M101 with M106 to turn the laser on, and replace M103 with M107 to turn the laser off. All of the M102's are just removed because we don't care about the actual retractions.
Thankfully the software is very customizable, so I've been able to use it for a lot of different applications with only a few changes