New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding M42 gcode to layer 2 on every slice? #3627

Closed
PicoPi opened this Issue Apr 6, 2018 · 16 comments

Comments

Projects
None yet
4 participants
@PicoPi

PicoPi commented Apr 6, 2018

This is not a bug. I just don't know where else to turn to.
I want to add an M42 P6 S255 to the start of layer 2 on every file I slice with cura.
How can I do that?
There is a place for start and end gcodes, but nothing in between.
I know there must be a way, but after a few hours, I give up.
Thanks for any help.

@smartavionics

This comment has been minimized.

Contributor

smartavionics commented Apr 6, 2018

You can do this with the search and replace post-processing script. I have tested this and it works. There's something broken with entering text in Cura at the moment so it tends to forget what you have just entered into a field.

screenshot_2018-04-06_07-34-47

@fieldOfView

This comment has been minimized.

Contributor

fieldOfView commented Apr 6, 2018

Note that the Search in @smartavionics' example will only detect the first layer change. I would use this instead:

Search:
;LAYER:
Replace:
M42 P6 S255\n;LAYER:

That way it works on all layers and it keeps the layer number comments intact.

@smartavionics

This comment has been minimized.

Contributor

smartavionics commented Apr 6, 2018

Hi Aldo, the OP asks for the M42 to be output on the start of layer 2 not on all layers after layer 1 which is why I explicitly match that layer number. I agree that my solution leaves out the layer:1 comment.

@fieldOfView

This comment has been minimized.

Contributor

fieldOfView commented Apr 6, 2018

Doh, better brush up on my reading skills...

@smartavionics

This comment has been minimized.

Contributor

smartavionics commented Apr 6, 2018

BTW, I tried using ;LAYER:1$ as the search string but it didn't seem to understand $. Is that right?

@fieldOfView

This comment has been minimized.

Contributor

fieldOfView commented Apr 6, 2018

The string that is being matched is the whole layer, consisting of multiple lines. "$" matches the end of the string, not the end of a line.

@smartavionics

This comment has been minimized.

Contributor

smartavionics commented Apr 6, 2018

Ah, thanks, that makes sense.

@PicoPi

This comment has been minimized.

PicoPi commented Apr 6, 2018

omg, Thank you. Works like a charm!

@PicoPi PicoPi closed this Apr 6, 2018

@PicoPi

This comment has been minimized.

PicoPi commented Apr 6, 2018

It works, but as you said, it forgets!
Is there any way to fix the code?
As it is, it would be no different from opening the gcode in Notepad++ and doing a search and replace manually! Wanted to avoid doing that for each and every file I slice.

@fieldOfView

This comment has been minimized.

Contributor

fieldOfView commented Apr 6, 2018

In Cura 3.3, the setting will persist between launches of Cura. In the Cura 3.3 beta there is currently a bug that will make the setting not "take" unless you type it in very slowly.

@PicoPi

This comment has been minimized.

PicoPi commented Apr 6, 2018

Where do I get the 3.3? I found 3.3 Beta, but not 3.3!

@smartavionics

This comment has been minimized.

Contributor

smartavionics commented Apr 6, 2018

3.3 isn't released yet.

@PicoPi

This comment has been minimized.

PicoPi commented Apr 6, 2018

me so sad :(

@PicoPi

This comment has been minimized.

PicoPi commented Apr 6, 2018

I downloaded the 3.3 Beta for shits and giggles, and also out of desperation. I typed it slow, and now it remembers, and is no longer suffering from amnesia !! Yey
Do you happen to know which python source is responsible for this function?

@smartavionics

This comment has been minimized.

Contributor

smartavionics commented Apr 6, 2018

The amnesia problem is in Uranium, the commit that fixes it is:

Ultimaker/Uranium@7b53e35

@PicoPi

This comment has been minimized.

PicoPi commented Apr 6, 2018

Dude! u d man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment