Jump to content

Cuq

Expert
  • Posts

    675
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by Cuq

  1. 1 hour ago, darkdvd said:


    ...cette option n'est active que si on active "Tree Support" > "Generate support", étrange.

    Je pense plutôt que cette option n'est active que si tu n'as pas de Support (classique)  d'activé ...  Après si tu utilises les supports arborescent , tu dois désactiver l'option Support classique donc peut être logique qu'elle devienne active aussi à ce moment là ?

  2. Tu peux dans la config de cura modifier les 25mm si tu veux imprimer des pièces plus hautes . C'est une sécurité mais rien n’empêche de forcer ce paramètre.

     

    En impression "un à la fois" l'ordre n'est pas aléatoire mais correspond à l'ordre dans le quel les pièces ont été rajouté. Donc ça permet justement de placer les pièces de manière à éviter les collisions

     

    C'est ordre est fixe sauf si justement Cura détecte une collision d'une zone de pièce  par rapport à la zone de tete défini dans les paramètre. Dans ce cas il va proposer un ordre qui "évite" cette collision. Dans tous les cas en impression "Un a la fois" Il est préférable de bien comprendre ce que l'on fait et simuler les enchaînement avant de lancer un print à l'aveugle

  3. Depuis la version 2.3.0 le Settings Guide est aussi dispo en français ( je pense depuis 4.6)  si le texte n’apparaît pas directement en français il faut lui indiquer la langue. Une fois la langue choisi elle restera active

    InkedsettingsGuide_LI.jpg

  4. l'ajout de ces codes sur les ecrans LCD se fait via les scripts de post traitement . Tu vas dans Extensions -> Post-traitement -> Modifier le G-code et tu rajoutes les scripts déjà fournis comme Display Filnename and Layer on LCD (Affiche ce que tu demandes) ou Display Remaining Time : Qui lui va afficher le temps restant.   Il existe aussi sur le Groupe Facebook Cura3D francophone  une version de script DisplayPrintInfoOnLcd.py  qui fait les deux ( affichage layer et temps restant)

  5. 35 minutes ago, ahoeben said:

    I would advice against removing all gcode, because the user will not see that and an empty file will be saved but Layer View will still show the original sliced layers.

     

    Ok Finaly As I prefer to not generate anything  I will use :

     

            if relativeextrusion == False:
                #
                Logger.log('d', 'Gcode must be generate in relative extrusion mode')
                Message('Gcode must be generate in relative extrusion mode', title = catalog.i18nc("@info:title", "Post Processing")).show()
                return None

     

    In case of wrong setting, I will get just the error message , No file generated, No message in relation of a generated file, No risk to print something which is not correct or can generate inappropriated  extruder instructions.

     

    Thanks  again for your help @ahoeben

     

  6. 34 minutes ago, ahoeben said:

    Why raise a SyntaxError though? That's like using a hammer to stir your coffee. Wouldn't a simple "return" work?

     

    That's a good question and you can certainly help me on this point.   I can use just "return" like

    return('; Gcode must be generate in relative extrusion')

    In this case this return will generate an error  'TypeError: 'str' object does not support item assignment'    but the advantage No Gcode Will be generated and I will get just the Error Message .  But it's not a 'Clean Solution'

     

    Or I can also return the data with just one line. But how to resize  the data item ?

                data.resize(0)
                data[0] = '; Gcode must be generate in relative extrusion'
                return data

     

  7. Thanks @ahoeben  , finaly it was just a problem of speed, the message was displayed but as extra messages were displayed, I wasn't seen the message in the Cura software.  I 'solved' this issue by adding a  Raise instruction to stop the script:

     

    from ..Script import Script
    from UM.Logger import Logger
    from UM.Application import Application
    from cura.Settings.ExtruderManager import ExtruderManager
    from UM.Message import Message
    from UM.i18n import i18nCatalog
    import re #To perform the search and replace.
    catalog = i18nCatalog("cura")
    
    ...
    
            extrud = list(Application.getInstance().getGlobalContainerStack().extruders.values())
    
            infillpattern = extrud[extruder_id].getProperty("infill_pattern", "value")
            relativeextrusion = extrud[extruder_id].getProperty("relative_extrusion", "value")
            if relativeextrusion == False:
                #
                Logger.log('d', 'Logger: Gcode must be generate in relative extrusion')
                Message('Message : Gcode must be generate in relative extrusion', title = catalog.i18nc("@info:title", "Post Processing")).show()
                raise SyntaxError('SyntaxError : Gcode must be generate in relative extrusion')

     

    Message.jpg

  8. Hello,

     

    Is it possible to display a message in a Python Cura Postprocessing PlugIn Script. I know how to add a log text via :

    from UM.Logger import Logger
    
    Logger.log('d',  "Error" )

    I have tried 

     

    from UM.Logger import Logger
    from UM.Message import Message
    from UM.i18n import i18nCatalog
    catalog = i18nCatalog("cura")
    
     Message("Error\n", title = catalog.i18nc("@info:title", "Post Processing")).show()
    

     But it doesn't work

  9. Hello 

     

    I'm looking for a documenation concerning the different property we can get via this function. Up to now I was mainly getting the Value and the Label but I want to know if it's also possible to get the unit and other different informations.

     

    Best regards,

     

    Cuq

  10. On 1/27/2019 at 3:18 PM, ctbeke said:

     

    Indeed the Marketplace only works for full plugins and material/quality packages at the moment. I do however like the idea of distributing post processing scripts through the Marketplace as well. I'll discuss it with the product owners of Cura and Cloud and see if it's something Ultimaker will work on. Technically it shouldn't be too hard.

     

    As a workaround you could make a small 'extension' plugin that simply copies your script to the Cura user directory on boot. I know the Dremel plugin that's currently available in the Marketplace does something similar but then for machine definition files.

     

    Any news about this possibility to store in one place and share such type of Posprocessing scripts ?

  11. Hello @nallath and @ahoeben ,

     

    Thanks for your help , None of these solutions seems to work, If it's just a word I've got a translation but a complex label is not translated.

     

    Tested :

    from UM.i18n import i18nCatalog
    
    catalog = i18nCatalog("cura")
    
    untranslated_label = Application.getInstance().getGlobalContainerStack().getProperty("layer_height", "label")
    translated_label = catalog.i18n(untranslated_label)

    and 

     

    from UM.i18n import i18nCatalog
    
    catalog = i18nCatalog("cura")
    
    untranslated_label = Application.getInstance().getGlobalContainerStack().getProperty("layer_height", "label")
    translated_label = catalog.i18nc("@label", untranslated_label)

     

    with the same result 😞

  12. Hello,

     

    I'm looking for a solution to get the translation of  a label  parameter. I can get the label or the description inthe default langage but I don't know how to get it the the right translated text.

     

            #   layer_height
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("layer_height", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("layer_height", "label")

     

  13. Thank you @ahoeben !!!!   That's OK :

    • Profile name
    • Material name
    • Quality
            # add extruder specific data to slice info
            extruders = list(Application.getInstance().getGlobalContainerStack().extruders.values())
            #   Profile
            GetValStr = extruders[0].qualityChanges.getMetaData().get("name", "")
            GetLabel = "Profile"
            replace_string = replace_string + "\n; " + GetLabel + "                      : " + GetValStr        
            #   Material
            GetValStr = extruders[0].material.getMetaData().get("material", "")
            GetLabel = "Material"
            replace_string = replace_string + "\n; " + GetLabel + "                     : " + GetValStr
            #   Quality
            GetValStr = extruders[0].quality.getMetaData().get("name", "")
            GetLabel = "Quality"
            replace_string = replace_string + "\n; " + GetLabel + "                      : " + GetValStr

     

  14. Ok step by step I'm closer to my goal   to get the Material name I'm using this code :

     

            # add extruder specific data to slice info
            extruders = list(Application.getInstance().getGlobalContainerStack().extruders.values())
            GetValStr = extruders[0].material.getMetaData().get("material", "")

     

    Does anyone of you knows how to get the Profil name ? 

  15. 1 hour ago, gr5 said:

    This is beyond my knowledge but maybe @burtoogle or @ctbeke or @ahoeben can help or at least know who can.

     

    54 minutes ago, ahoeben said:

    A printer has one global stack that has common settings, but it typically has no materials. A printer also has one or more Extruder Stacks. You need to get the material from the extruder stack. This might work (but I have not tested it):

    
    GetValStr = Application.getInstance().getGlobalContainerStack().extruders[0].material.getMetaData().get("material", "")

    There are other settings that you should be getting from the extruder stack too, like material_diameter, material_flow, retraction+*, material_print_temperature, machine_nozzle_size, infill_*, speed_*

     

     

    There's a lot of code duplication in your script. You don't need to get the global stack over and over again; store it in a variable.

     

    For the the majority of these parameters ( material_print_temperature, machine_nozzle_size , material_diameter etc ) . GetProperty function retrun the right values.

    GetVal = Application.getInstance().getGlobalContainerStack().getProperty("machine_nozzle_size", "value")

    But I don't find any parameter for the profil name  and the material base. 

     

    GetValStr = Application.getInstance().getGlobalContainerStack().extruders[0].material.getMetaData().get("material", "")

    Doesn't seems to be a valide solution

  16. Hello,

     

    I'm trying to create my own postprocessing script. The goal of the script is to add at the beginning of the GCode file different comments to keep the print profile.  For the print parameter I don't have anny problem to get the values , but I don"t know how to get the Name of the profile and the initial material name.  I'have made a test with a command line like :

    GetValStr = Application.getInstance().getGlobalContainerStack().material.getMetaData().get("material", "")

    but this line return an empty value.  hereafter the actual sample code 

    import re #To perform the search and replace.
    
    from ..Script import Script
    from UM.Application import Application #To get the current printer's settings.
    ##  Performs a search-and-replace on all g-code.
    #
    #   Due to technical limitations, the search can't cross the border between layers.
    class Documentation(Script):
        def getSettingDataString(self):
            return """{
                "name": "Documentation parametres",
                "key": "Documentation",
                "metadata": {},
                "version": 2,
                "settings":
                {
                    "search":
                    {
                        "label": "Search",
                        "description": "All occurrences of this text will get replaced by the parameter list.",
                        "type": "str",
                        "default_value": ";FLAVOR:Marlin"
                    }
                }
            }"""
    
        def execute(self, data):
            search_string = self.getSettingValueByKey("search")
            search_regex = re.compile(search_string)
    
            replace_string = search_string
            replace_string = replace_string + "\n;==============================================\n;  Documentation\n;=============================================="   
            #   machine_nozzle_size
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("machine_nozzle_size", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("machine_nozzle_size", "label")
            replace_string = replace_string + "\n; " + GetLabel + "              : {Val} mm".format(Val = GetVal)
            #   material_guid
            GetValStr = Application.getInstance().getGlobalContainerStack().material.getMetaData().get("material", "")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("material_guid", "label")
            replace_string = replace_string + "\n; " + GetLabel + "     : " + GetValStr
            #   layer_height
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("layer_height", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("layer_height", "label")
            replace_string = replace_string + "\n; " + GetLabel + "                 : {Val} mm".format(Val = GetVal)        
            #   line_width 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("line_width", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("line_width", "label")
            replace_string = replace_string + "\n; " + GetLabel + "                   : {Val} mm".format(Val = GetVal)
            #   material_print_temperature 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("material_print_temperature", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("material_print_temperature", "label")
            replace_string = replace_string + "\n; " + GetLabel + "         : {Val}°C".format(Val = GetVal)
            #   speed_print 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("speed_print", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("speed_print", "label")
            replace_string = replace_string + "\n; " + GetLabel + "                  : {Val} mm/s".format(Val = GetVal)
            #   speed_infill 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("speed_infill", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("speed_infill", "label")
            replace_string = replace_string + "\n; " + GetLabel + "                 : {Val} mm/s".format(Val = GetVal)        
            #   material_flow 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("material_flow", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("material_flow", "label")
            replace_string = replace_string + "\n; " + GetLabel + "                         : {Val} %".format(Val = GetVal)
            #   retraction_enable 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("retraction_enable", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("retraction_enable", "label")
            replace_string = replace_string + "\n; " + GetLabel + "            : [{Val}]".format(Val = GetVal)
            #   retraction_speed 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("retraction_speed", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("retraction_speed", "label")
            replace_string = replace_string + "\n; " + GetLabel + "             : {Val}".format(Val = GetVal)        
            #   support_enable 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("support_enable", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("support_enable", "label")
            replace_string = replace_string + "\n; " + GetLabel + "             : [{Val}]".format(Val = GetVal)
            #   support_type
            GetValStr = Application.getInstance().getGlobalContainerStack().getProperty("support_type", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("support_type", "label")
            replace_string = replace_string + "\n; " + GetLabel + "            : " + GetValStr        
            #   infill_sparse_density 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("infill_sparse_density", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("infill_sparse_density", "label")
            replace_string = replace_string + "\n; " + GetLabel + "               : {Val} %".format(Val = GetVal)
            #   infill_pattern
            GetValStr = Application.getInstance().getGlobalContainerStack().getProperty("infill_pattern", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("infill_pattern", "label")
            replace_string = replace_string + "\n; " + GetLabel + "               : " + GetValStr
            #   material_diameter 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("material_diameter", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("material_diameter", "label")
            replace_string = replace_string + "\n; " + GetLabel + "                     : {Val} mm".format(Val = GetVal)
            #   ironing_enabled 
            GetVal = Application.getInstance().getGlobalContainerStack().getProperty("ironing_enabled", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("ironing_enabled", "label")
            replace_string = replace_string + "\n; " + GetLabel + "               : [{Val}]".format(Val = GetVal)
            #   adhesion_type
            GetValStr = Application.getInstance().getGlobalContainerStack().getProperty("adhesion_type", "value")
            GetLabel = Application.getInstance().getGlobalContainerStack().getProperty("adhesion_type", "label")
            replace_string = replace_string + "\n; " + GetLabel + "    : " + GetValStr          
            #   Fin de commentaire 
            replace_string = replace_string + "\n;=============================================="
            
            for layer_number, layer in enumerate(data):
                data[layer_number] = re.sub(search_regex, replace_string, layer) #Replace all.
    
            return data

     

×
×
  • Create New...