Jump to content
Ultimaker Community of 3D Printing Experts
cadshef

SelectExtruder Plugin in Cura 2.5 Beta 2

Recommended Posts

Is it possible to use SelectExtruder Plugin in Cura 2.5 Beta 2?

I tried to put the file SelectExtruder.py to the folder C :\Program Files\Cura\Plugins and to the folder

C :\Program Files\Cura\Plugins\PostProcessngPlugin\Scripts, but it does not give a result !

Please help me anybody - how is it correct to set and start Plugin, that Cura saw him?

Edited by Guest

Share this post


Link to post
Share on other sites

@DaHai8, is there any chance that you could assist?

 

Sure, I'd be happy to. Looks like its on GitHub: https://raw.githubusercontent.com/Dim3nsioneer/Cura-Plugins/legacy/SelectExtruder.py

 

#Name: Select Extruder 15.01#Info: Adjusts the used extruder for a single material print#Help: SelectExtruder#Depend: GCode#Type: postprocess#Param: ExtruderNo(int:0) Extruder to be used (0: 1st ex., 1: 2nd ex.)## Written by Stefan Heule, Dim3nsioneer@gmx.ch## This script is licensed under the Creative Commons - Attribution - Share Alike - Non Commercial (CC BY-SA-NC) 3.0 termsversion = '15.01'import reimport wximport timetry:#MacOS release currently lacks some wx components, like the Publisher.from wx.lib.pubsub import Publisherexcept:Publisher = None

 

If that's not the right one, let me know.

I'll start hacking away at it...

Share this post


Link to post
Share on other sites

Ok, here's the converted script. Tested on 2.5.0 Release. I generated some g-code with/without this post-processing-plugin and it appeared to make the correct changes for the extruder number. But I don't have a multi-extruder printer to test with - so Caveat Emptor :)

You can also download if from here: SelectExtruder.zip

And pasted below:

 

#!/usr/bin/env python#Name: Select Extruder 15.01#Info: Adjusts the used extruder for a single material print#Help: SelectExtruder#Depend: GCode#Type: postprocess#Param: ExtruderNo(int:0) Extruder to be used (0: 1st ex., 1: 2nd ex.)# Written by Stefan Heule, Dim3nsioneer@gmx.ch# This script is licensed under the Creative Commons - Attribution - Share Alike - Non Commercial (CC BY-SA-NC) 3.0 terms## Hacked for Cura 2.x by Da Hai Zhu - appologies to the original author# Handles up to 10 extruders (0-9) - should last another year, maybe...# 2017-04-24# version 2.5.0from ..Script import Scriptimport reclass SelectExtruder(Script):   def __init__(self):       super().__init__()   def getSettingDataString(self):       return """{           "name":"Select Extruder",           "key": "SelectExtruder",           "metadata": {},           "version": 2,           "settings":           {               "ext_Num":                {                   "label": "Extruder Number (0 - n)",                   "description": "0 = 1st, 1 = 2nd, etc...",                   "unit": "",                   "type": "int",                   "default_value": 0               }           }       }"""   def execute(self, data):       extNum = self.getSettingValueByKey("ext_Num")       for layer in data:           index = data.index(layer)           lines = layer.split("\n")           for line in lines:               if "M109" in line: #look for M109 command (heat up and wait)                   layer = layer.replace(line, re.sub("M109.+(S\d+)","M109 T%d \g<1>\nT%d\n" % (int(extNum),int(extNum)),line))               elif "M104" in line: #look for M104 command (temperature change)                   layer = layer.replace(line, re.sub("M104.+(S\d+)","M104 T%d \g<1>\nT%d\n" % (int(extNum),int(extNum)),line))               elif re.search("T\d",line) and "M200" not in line:                   layer = layer.replace(line, re.sub("T\d","T%d\n" % int(extNum),line))           data[index] = layer       return data

 

Share this post


Link to post
Share on other sites

DaHai8, you're THE man - as always :-) Thank you very much, I will give it a try tomorrow afternoon (when my wifey is outa home :-) )

@ Zerspaner_Gerd, unfortunately yes as there is no option in a dual setup to heat only the one required nozzle and not both. only workaround is to use a single setup for single prints and there is no nozzle selection possible... so thanks to DaHai8's magic there is again the possibility to select the nozzle on a single nozzle print without manual tweaking.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Terms of Use Privacy Policy