Modify job.filePosition value
-
Hi,
Is it possible to assign a value to job.filePosition if a gcode is not running? I would like to take advantage of the value in the GcodeViewer (scrubPosition), to restart a print from that point.
Thank you!
-
-
This post is deleted! -
M26 works perfectly.
What I want to achieve is that when I press a button in gcodeviewer it stores the scrubPosition value directly in a variable that I can use in M26 and I don't have to enter it manually.
Unfortunately I have not found any variable in the source code that I can work with later in duet.
I thought about using job.filePosition, but it does not allow me to modify its value, only to read it. -
@amimafe so read it using job.filePosition and set it when you need to using M26.
-
I have been able to add a button in the Gcodeviewer Plugin and what I would like is to be able to save the value of ScrubPosition (the position of the gcode where the mouse points), in a variable that I can read in duet, when I press this button. I thought I could do it in the job.filePosition object, but I can't do it.
I have added the following function but it doesn't work. I apologize because I don't have a lot of programming knowledge and I'm trying to learn little by little:On the other hand I have a problem when resuming a printout with the command M26 S{job.filePosition}. I must enter before G92 Ennn with the corresponding extrusion value of the code line where it is going to start or it is not strictly necessary?
-
@amimafe regarding entering G92 Ennn, if you slice the file in relative extrusion mode (which is what we recommend) then that's not necessary.
-
@dc42
Ok, thanks a lot for your help. If I get it working, I'll post it on the forum for anyone who might be interested.