Sure! I used the script and schematic on this (german) page:
I have the same power supply here (DC/DC converter on 3D-printer PSU). To shutdown the PI (model 3 B) I press the button and wait for the green activity light to become always on. Then I can switch off the printer.