end_gcode error: Parsing error at line 4: Not a variable name
 
Notifications
Clear all

[Solved] end_gcode error: Parsing error at line 4: Not a variable name  

  RSS
Jason H
(@jason-h)
Active Member
end_gcode error: Parsing error at line 4: Not a variable name

Present in 2.3.0 and 2.4.1 on a Mac. Not M1 chip.

If I load up a stock preset, 0.2mm DETAIL, along with Generic ABS and any STL I can generate the above error code. This must be known as a bug or a really bizarre feature. All I do is click on the Printer Settings tab for a stock MK3S preset and then if I click on Custom G-code it injects the line below and generates the subject error.

{if print_settings_I'd=~/.*(DETAIL @MK3|QUALITY @MK3|@0.25 nozzle MK3).*/}M907 E538 ; reset extruder motor current{endif}

This behaviour has no intervention from me other than using stock presets and any STL. All I do is click on Custom G-code and it generates this error. It will not slice, with the above error. However, if I open Prusaslicer and select all the same presets, load a random STL, but do not VIEW the Custom G-code in the Printer Settings tab, it slices fine. 

Once I view the Custom G-code, it changes the preset to (modified) even though I have not modified anything. Am I typing a whole lot for a known issues? I didn't seem to find anything on search. Legacy preference that needs to be trashed? Delete presets and reinstall?

Posted : 19/04/2022 4:41 pm
Tim Weston
(@tim-weston)
Estimable Member
RE:

Hi,

Line 4 of the end_gcode section in a stock MK3S preset from 2.4.1 on my Mac reads:

{if print_settings_id=~/.*(DETAIL @MK3|QUALITY @MK3|@0.25 nozzle MK3).*/}M907 E538 ; reset extruder motor current{endif}

Your text above indicates that you are trying to reference a variable called 'print_settings_I'd'.

Not sure how the typo arrived there for you, but if you correct it the STL will slice as expected.

Perhaps delete and reinstall the system presets then?

Cheers,

Tim

Posted : 19/04/2022 4:55 pm
Jason H
(@jason-h)
Active Member
Topic starter answered:
RE: end_gcode error: Parsing error at line 4: Not a variable name

I used app cleaner to remove it and scoured the folders, it still has the ' in I'd. I believe it's my Mac trying to autocorrect with the app.

Yep, sure enough. Did some digging and it appears my custom text dictionary from my iPhone carries over to my Mac and - on my iPhone - when I type Id it is supposed to autocorrect with I'd. It is supposed to be case sensitive and only what I type. Not ignore case, and change text inside app windows where no typing has occurred. 

Hope someone finds this on the future and stops pulling their hair out. 

Posted : 19/04/2022 5:29 pm
Neophyl
(@neophyl)
Illustrious Member
RE: end_gcode error: Parsing error at line 4: Not a variable name

You don’t have some form of autocorrect enabled on your machine do you ?  As changing id to I’d looks a LOT like what an auto correct would do. So it sounds like when you view it an autocorrect is kicking in and changing the text. 

Posted : 19/04/2022 5:30 pm
Share: