From 5ae5dfd3ad3c954762b25d2ebf92326037cfaef8 Mon Sep 17 00:00:00 2001 From: griehsler Date: Sat, 20 Oct 2018 01:28:48 +0200 Subject: [PATCH] added x_position and y_position to postprocessing filamentchange parameters --- .../scripts/FilamentChange.py | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/FilamentChange.py b/plugins/PostProcessingPlugin/scripts/FilamentChange.py index 0fa52de4f1..a39be10ddc 100644 --- a/plugins/PostProcessingPlugin/scripts/FilamentChange.py +++ b/plugins/PostProcessingPlugin/scripts/FilamentChange.py @@ -44,6 +44,22 @@ class FilamentChange(Script): "unit": "mm", "type": "float", "default_value": 300.0 + }, + "x_position": + { + "label": "X Position", + "description": "Extruder X position. The print head will move here for filament change.", + "unit": "mm", + "type": "float", + "default_value": 0 + }, + "y_position": + { + "label": "Y Position", + "description": "Extruder Y position. The print head will move here for filament change.", + "unit": "mm", + "type": "float", + "default_value": 0 } } }""" @@ -54,6 +70,8 @@ class FilamentChange(Script): layer_nums = self.getSettingValueByKey("layer_number") initial_retract = self.getSettingValueByKey("initial_retract") later_retract = self.getSettingValueByKey("later_retract") + x_pos = self.getSettingValueByKey("x_position") + y_pos = self.getSettingValueByKey("y_position") color_change = "M600" @@ -62,7 +80,13 @@ class FilamentChange(Script): if later_retract is not None and later_retract > 0.: color_change = color_change + (" L-%.2f" % later_retract) - + + if x_pos is not None: + color_change = color_change + (" X%.2f" % x_pos) + + if y_pos is not None: + color_change = color_change + (" Y%.2f" % y_pos) + color_change = color_change + " ; Generated by FilamentChange plugin" layer_targets = layer_nums.split(",")