Both of these solutions work, thanks. I put in the triple quotes because my example had them. Sigh. It never occurred to me that if I put the warming commands in that CURA would see that and not add them.
For anyone who cares, this is the fixed script:
#!/usr/bin/env python from ..Script import Script class AddPowerOn(Script): def __init__(self): super().__init__() def getSettingDataString(self): return { "name":"Add Power On Before Warming", "key": "AddPowerOn", "metadata": {}, "version": 2, "settings": {} } def execute(self, data): for layer in data: index = data.index(layer) layer = "M80\nG4 P3000\n" + layer data[index] = layer #Override the data of this layer with the modified data return data break return dataEdited by Guest
Mistakenly duplicated content.
I am still wondering what a "gcode exit" is though. I guess you mean "gcode script" or "gcode plugin", but I am curious how you get from the word "exit" to the word "plugin".
Recommended Posts
DaHai8 74
Not sure about 'exits', but I think the primary issue with your Python script is the version. It should be version 2, and I don't think you need the triple quotes on the return as well.
Here's a fixed version of your script: http://bitman.org/dahai/AddPowerOn.zip
I think the reason they call it Python is its very temperamental and will snap back and bite you if you do something wrong...
Hope this helps.
Link to post
Share on other sites
ahoeben 1,981
Instead of fixing your problem with a custom postprocessing script, let me try to fix the root of your problem.
The reason CuraEngine puts the bed/nozzle temperature commands in front of your start gcode is because your start gcode does not contain commands to heat the bed/nozzle. Make sure the following snippet is in the appropriate place in your start gcode:
This will make sure CuraEngine does not have to add it by itself, and you can put your M80 and G4 before the temperature commands.
Edited by GuestLink to post
Share on other sites