Jump to content

Anzahl aktiver Extruder mit Pythonscript ermitteln


Deltaflyer

Recommended Posts

Posted · Anzahl aktiver Extruder mit Pythonscript ermitteln

Hallo, ich versuche das Cura Post Prozessing Script 'FilamentChange.py' anzupassen, um im Script den Extruder anzugeben, der das filament wechseln soll. (M600 T0/T1, )

Dies ist mir soweit auch gelungen, dass ich jetzt ein zusätzliches Eingabefeld im Script habe, wo ich 0 oder 1 eingeben kan, um den gewünschten Extruder auszuwählen.

Jetz möchte ich aber gerne, dass diese Auswahl nur dann möglich ist, wenn auch ein Drucker mit mehreren aktiven Extrudern als aktiver Drucker in Cura ausgewählt ist.

Die Frage ist also: wie kann mein Script die Anzahl der zur Verfügung stehender aktiver Extruder ermitteln?

 

Danke für eure Bemühungen.

 

 

  • Link to post
    Share on other sites

    Posted (edited) · Anzahl aktiver Extruder mit Pythonscript ermitteln

    Hallo,

     

     

    Hier ein paar Beispiele wie man Settings aus der Cura Oberfläche auslesen kann:

     

    from UM.Application import Application
    from cura.Settings.ExtruderManager import ExtruderManager
    
    global_stack = Application.getInstance().getGlobalContainerStack()
    t0_extruder_stack = ExtruderManager.getInstance().getActiveExtruderStacks()[0]
    t1_extruder_stack = ExtruderManager.getInstance().getActiveExtruderStacks()[1]
    
    prime_tower_enable = global_stack.getProperty("prime_tower_enable", "value")                                # Turm ON/OFF
    
    skirt_brim_line_width = t0_extruder_stack.getProperty("skirt_brim_line_width", "value")                     # Linien Breite um Breite Brime zuberechnen

     

    So nun musst du halt den richtigen Setting Namen herausfinden, dazu habe ich immer die Datei "fdmprinter.def.json" (diese befindet sich im Installation Ordner "resources\definitions")

     

    Habe mir auch irgendwo mal abgeschaut, bin somit kein Profi und müsste auch erst suchen welcher Setting Name es wäre.

    Müsste aber über global funktionieren.

    Ein weitere Tipp, Cura auf Englisch stellen und mit den Setting Namen (in deinen Fall "Anzahl Extruder") in der genannten Datei suchen

     

    Gruß

    Edited by zerspaner_gerd
    Ein Import Vergessen
  • 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 Universal Cura Projects in the UltiMaker Cura 5.7 beta
        Strap in for the first Cura release of 2024! This 5.7 beta release brings new material profiles as well as cloud printing for Method series printers, and introduces a powerful new way of sharing print settings using printer-agnostic project files! Also, if you want to download the cute dinosaur card holder featured below, it was specially designed for this release and can be found on Thingiverse! 
          • Like
        • 10 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...