Jump to content

Cuq

Member
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. Hello I'm using in my Python scripts a function which seems to be obsolet in the new release of Cura : extrud = list(Application.getInstance().getGlobalContainerStack().extruders.values()) How to modify this code to get a valid Syntex ? Best regards,
  2. 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
  3. 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
  4. 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')
  5. New feature already mentionned on the Cura Github : https://github.com/Ultimaker/Cura/issues/6954#issuecomment-576047725
  6. 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
  7. This question is certainly for @ghostkeeper . Is there a solution to translate the PlugIn 'Cura setting guide' into our native language ? Best regards, Edit : I have made an 'official' Feature request on the Github site
  8. Hello, Is there an option or a parameter to reduce or limit the size of the cura.log file ? After a while the file become very bigger and I don't want to delete manually this file every time. Best regards,
  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. Thanks a lot for your work @burtoogle, I like your new Schwarz D pattern. The Gyroïde pattern is already nice but the Schwarz D pattern are faster and it generate less wobbling movements. On the other hand I am not convinced by the Schwarz P(rimimitif) pattern.
  11. Any news about this possibility to store in one place and share such type of Posprocessing scripts ?
  12. 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 😞
  13. 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")
  14. 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
  15. 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 ?
×
×
  • Create New...

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!