I'm going to use it in a file in cura that will be added when I generate a gcode, path: cura/5.5/definitions/my_machine.def.json and you scrool to the end and it will be on "machine_start_gcode", there I can call any function that I have and pass parameters, this paramns is on the file that I sent before or you can find in the same folder but fdmprinter.def.json, but there is no variable to see if is enable or disable. i don't know if it exists, if it does please tell me.
Okay, so that's just startup gcode you want to edit:
Hate to break it to you, but it's not that easy. That's strictly a text field, it can't perform any logic on its own, it can't run functions. All that happens to it is Cura unescapes sequences (like \n to a new line) and replace replacement patterns (like {material_print_temperature} to 210).
To perform different actions to the gcode depending on if an extruder is on would require writing a post-processing script and querying the application stack for each extruder (I make it sound harder than it is).
For what it's worth, remember that each extruder for a machine has its own start and end gcode that you can customise.
Recommended Posts
Slashee_the_Cow 410
Where are you trying to use the code - startup/end gcode, writing your own post-processor, editing the gcode by hand, or what?
Link to post
Share on other sites