Finished G-Code to set an Arduino sketch off...

Hi - I have a commercially produced 3d printer, not in the RepRap family. Is it at all possible, using Simplify3D or other slicing packages or Arduino IDE itself, to know when a 3D print is complete and set off an Arduino sketch?

For instance (stupid example), when the 3D printer has finished the print, an Arduino sketch turns on a light (the light has nothing to do with the 3D printer).

Just throwing that out there to hear your thoughts...

How does the printer get the G-Code from the file?
Perhaps there is some way to identify the end of the file?

Would it be practical to monitor something (perhaps the pulses to the stepper motor driver) and assume the job is done if there is no action for X seconds?

Would it be possible to add a command at the end of the G-Code file to make a stepper move to a position that triggers a switch?


Perhaps one way would to monitor the power going to the plastic string heater and when it goes off, the job is done.