Quote Originally Posted by syl20 View Post
Hi Roxy,

With my script :
- only one script file (~80 lines) ;
- no need to compile ;
- no initialisation for x_min, x_max, y_min, y_max (with yours, theses variables are set to 9999.9 > if marlin is set to use micrometer ? )
- no need to create a new gcode file ; the user file is updated in place ;
- input and outptut are streamed ;
I didn't know enough to get a Python script running on Slic3r, so I just made a quick and dirty C program to do it. If 9999.9 mm isn't enough, it is Open Source! The user can change it to 99999999.9 mm !

Anybody that doesn't want to compile, can just use the executable. Compiling isn't a big deal to (or for) me. I like my C compiler!

I could have updated in place by opening the file for read / write, but the problem is the G29 line grows in size when you add the extra parameters. So, it is more difficult than just inserting the extra information. Hence... the generation of a temporary file. Its only a few lines of code to rewrite the file once you know what you are going to do to it, so that is the path I went.

But back to your point.... If you can get your script to work with Slic3r, it probably would be best to just have one solution that works for everything. Do you care to give it a try?