From 703028d00d23286b73ca0cf18f624fda6a8810b6 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Thu, 26 Dec 2024 17:44:09 +0100 Subject: [PATCH] Adjustment bit for self.start_x, self.start_y --- plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py b/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py index 386e518c29..88cc8a5050 100644 --- a/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py +++ b/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py @@ -56,6 +56,8 @@ class PurgeLinesAndUnload(Script): self.machine_right = self.machine_width - 1.0 self.machine_front = 1.0 self.machine_back = self.machine_depth - 1.0 + self.start_x = None + self.start_y = None def initialize(self) -> None: super().initialize() @@ -352,7 +354,7 @@ class PurgeLinesAndUnload(Script): add_move("Y", self.machine_back) else: add_move("Y", self.machine_front) - if len(moves) <= 1: + if len(moves) == 1 and self.start_y: moves.append(f"G0 F{self.speed_travel} Y{self.start_y} ; Move to start Y\n") # Combine moves into a single G-code string or return a comment if no movement is needed return "".join(moves) if len(moves) > 1 else f";----------[Already at {location_name}, No Moves necessary]\n"