GregValiant 1,112
I have a post that removes all the comments. It's one of the 8 scripts included in "Little Utilities". I guess UM2's don't like all the comments either.
In regards to Slashee's "AddSentenceNumbers" she will likely take a look at it tomorrow. Maybe add numbering the comments as an option, or you could run "Remove Comments" first and then do the numbering.
The last section of any Cura gcode file is all comments and includes the setting differences between the stock profile and whatever you changed for the print. That section isn't in the gcode during post processing so it can't be removed. The same goes for the line " ;POSTPROCESSED" which is also added after post processing is complete.
If either the last section " ;SETTING_3 " or the line " ;POSTPROCESSED" is an issue they would need to be manually deleted.
Edited by GregValiant
-
1
-
2
Recommended Posts
Slashee_the_Cow 25
Try this, although it's pretty crude and modifies every line in the g-code which isn't a comment. Copy AddSentenceNumbers.py file inside the zip file I attached into the scripts folder in your Cura configuration folder (if you don't know where that is, in Cura, go to Help > Show Configuration Folder). Restart Cura.
In the Cura menus go to Extensions > Post Processing > Modify G-Code. That should bring up a window with post processing scripts (you might not have any turned on). Click Add a script, and choose Add Sentence Numbers. Then just set the options to the right of that (Sentence Number Prefix - what needs to start the line - in your case just put N in that box) and if necessary change the starting number (surely someone has a printer which is zero-based).
Oh, and please let me know how it goes. Seeing the results in g-code on my computer is one thing but knowing if something actually works in a real world situation is something else entirely.
AddSentenceNumbers.zip
Edited by Slashee_the_CowUpdated version of script attached
Link to post
Share on other sites
Ov3rDr1ve 0
Thank you very much for your help 🙂
It works for me aswell. The only thing i noticed is, that N1 starts at the comment Postprocessed...
;MINZ:0.3
;MAXX:73.3
;MAXY:71.299
;MAXZ:8
N1 ;POSTPROCESSED
;Generated with Cura_SteamAngine 5.4.0
N2 M140 S60
N3 M105
N4 M190 S60
I am not sure if this will be a problem or not, but i guess if there is no real command in the sentence then the program will jump to the next sentence.
But thank you very much 🙂
PS: Is it also possible to delete all the comments ind the Code?
Codesys sees the comments as error but still accepts the code. So that means that your Script is working 🙂
Edited by Ov3rDr1veLink to post
Share on other sites