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

  • Our picks

    • Introducing Ultimaker Cura 3.6 | Beta
      Ultimaker Cura 3.6 | Beta is available. It comes with new features, bug fixes, and UX improvements. We would really like to have your feedback on it to make our stable release as good as it can be. As always, you can download the beta for free from our website, for Windows, MacOS, and Linux.
        • Like
      • 95 replies
    • Print Core CC | Red for Ruby
      Q: For some users, abrasive materials may be a new subject matter. Can you explain what it is that makes a material abrasive when you are not sure which print core to use?
      A: Materials which are hard in a solid piece (like metals, ceramics and carbon fibers) will generally also wear down the nozzle. In general one should assume...
        • Like
      • 30 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!