From 436e3e84b8d148df6226deb75d24e821c2851272 Mon Sep 17 00:00:00 2001 From: GregValiant <64202104+GregValiant@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:43:08 -0500 Subject: [PATCH] Create PurgeLinesAndUnload_old.py Update PurgeLinesAndUnload.py Added 2 settings so the user can dictate where the prime blob will be. "Blob Location X" and "Blob Location Y". Delete PurgeLinesAndUnload_old.py I'm not sure how I do these things. --- .../scripts/PurgeLinesAndUnload.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py b/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py index 5f517a3939..de2b1c0f7a 100644 --- a/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py +++ b/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py @@ -142,6 +142,24 @@ class PurgeLinesAndUnload(Script): "unit": "mm ", "enabled": "add_purge_lines and prime_blob_enable and purge_line_location in ['front', 'left']" }, + "prime_blob_loc_x": + { + "label": " Blob Location X", + "description": "The 'X' position to put the prime blob. 'Origin at Center' printers might require a negative value here. Keep in mind that purge lines always start in the left front, or the right rear. Pay attention or the nozzle can sit down into the prime blob.", + "type": "int", + "default_value": 0, + "unit": "mm ", + "enabled": "add_purge_lines and prime_blob_enable and purge_line_location in ['front', 'left']" + }, + "prime_blob_loc_y": + { + "label": " Blob location Y", + "description": "The 'Y' position to put the prime blob. 'Origin at Center' printers might require a negative value here. Keep in mind that purge lines always start in the left front, or the right rear. Pay attention or the nozzle can sit down into the prime blob.", + "type": "int", + "default_value": 0, + "unit": "mm ", + "enabled": "add_purge_lines and prime_blob_enable and purge_line_location in ['front', 'left']" + }, "move_to_start": { "label": "Circle around to layer start ⚠️​", @@ -922,7 +940,10 @@ class PurgeLinesAndUnload(Script): speed_blob = round(float(self.nozzle_size) * 500) # Adjust speed if 2.85 filament if self.material_diameter > 2: speed_blob *= .4 + blob_x = self.getSettingValueByKey("prime_blob_loc_x") + blob_y = self.getSettingValueByKey("prime_blob_loc_y") blob_string = "G0 F1200 Z20 ; Move up\n" + blob_string += f"G0 F{self.speed_travel} X{blob_x} Y{blob_y} ; Move to blob location\n" blob_string += f"G1 F{speed_blob} E{self.prime_blob_distance} ; Blob\n" blob_string += f"G1 F{self.retract_speed} E-{self.retract_dist} ; Retract\n" blob_string += "G92 E0 ; Reset extruder\n"