Zorgonaute84
Posts: 58
Joined: Sun Feb 07, 2016 7:30 am

Re: Tip of the Day 8- Scripts tab, G-Code

Thanks for this amazing post.

Is there a list somewhere with all the variables names [] that we can used in the script tab ?

Thanks
CompoundCarl
Posts: 2005
Joined: Wed Aug 05, 2015 7:23 am

Re: Tip of the Day 8- Scripts tab, G-Code

I believe all of the available placeholder variables (i.e. the [] ones) are already listed at the beginning of this thread. That is the complete list.
arnljot
Posts: 4
Joined: Fri Mar 25, 2016 2:35 am

Re: Tip of the Day 8- Scripts tab, G-Code

KeyboardWarrior wrote:
[fan_speed_percentage]
[fan_speed_pwm] - for example, M106 S[fan_speed_pwm]
[extruder0_temperature] - for example, M104 S[extruder0_temperature] T0; this will take the layer 1 temperature for extruder 0
[extruder1_temperature]
...
[bed0_temperature] - for example, M140 S[bed0_temperature] T0; this will take the layer 1 temperature for bed 0
[bed1_temperature]
These and other variables seem to only be interpreted in the respective scripts where they are quoted as examples. I see this in version Simplify3D-3.0.2 on OSX. Because when I try to use [extruder0_temperature] and [extruder1_temperature] in Tool change script, they remain unparsed and end up like that in the final G-code.

These variables and boolean operations should work in any script, it would also be useful if one could define own variables and do simple arithmetic.
arnljot
Posts: 4
Joined: Fri Mar 25, 2016 2:35 am

Re: Tip of the Day 8- Scripts tab, G-Code

blaknite7 wrote: G1 X0 Y40 F4000 ; move to wait for temperatures
{IF NEWTOOL=0}M104 S165 T1; set T1, inactive extruder to 165 C
{IF NEWTOOL=0}M109 S205 T0; Set T0, new active extruder to T0 Temperature and wait for it to reach temperature before proceeding.
{IF NEWTOOL=1}M104 S165 T0; Cool T0 to 165
{IF NEWTOOL=1}M109 S205 T1; set T1, Heat T1 to T1 Temperature
I've taken the liberty to create a Wanhao compatible script and post it over at thingiverse. You can see it here
vudoprint
Posts: 4
Joined: Mon May 30, 2016 1:29 pm

Re: Tip of the Day 8- Scripts tab, G-Code

Hi,
Can anyone advise how to properly do multiple replace commands in the post processing section?

Here is my issue:
Since there is no Speed multiplier for skirt/Brim, in order to prime my head and print poly carbonate, I am slowing down the whole layer via speed override, then I need to ramp it up to 100%.

It works well, but only one time

{REPLACE "; layer 1," "M220 S10 ; Layer-1,"}
{REPLACE "; layer 2," "M220 S75 ; Layer-2,"}
{REPLACE "; layer 3," "M220 S100 ; Layer-3,"}

When I exit S3d, and open it again it transforms to:

{REPLACE "; layer 1
" "M220 S10 ; Layer-1"}
{REPLACE "; layer 2
" "M220 S75 ; Layer-2"}
{REPLACE "; layer 3
" "M220 S100 ; Layer-3"}

Anyone Can help me with this?? try it on your own
CompoundCarl
Posts: 2005
Joined: Wed Aug 05, 2015 7:23 am

Re: Tip of the Day 8- Scripts tab, G-Code

Looks like version 3.1.0 added support for commas in the post-processing section, so you can now use something like

{REPLACE "; layer 1," "M220 S10\n; layer 1,"}

and it will be saved correctly. The previous version didn't support commas in the post-processing section, so make sure you're using 3.1.0 if you want to do this.
Rockscout
Posts: 9
Joined: Sun Jun 12, 2016 6:26 pm

Re: Tip of the Day 8- Scripts tab, G-Code

What's the correct script for a little extra extrusion following toolhead movement? I'm using the "don't cross outline" feature which is like a big wipe movement. The long wipe drains the nozzle and leaves a 1 mm void in extrusion at the start of my perimeter layers.
CompoundCarl
Posts: 2005
Joined: Wed Aug 05, 2015 7:23 am

Re: Tip of the Day 8- Scripts tab, G-Code

Rockscout wrote:What's the correct script for a little extra extrusion following toolhead movement? I'm using the "don't cross outline" feature which is like a big wipe movement. The long wipe drains the nozzle and leaves a 1 mm void in extrusion at the start of my perimeter layers.
You don't need a script for that. Just use the "extra restart distance" setting. For example, if you make that 0.2mm, it will extrude an extra 0.2mm at the start of each perimeter after doing a retract
Rockscout
Posts: 9
Joined: Sun Jun 12, 2016 6:26 pm

Re: Tip of the Day 8- Scripts tab, G-Code

CompoundCarl wrote:
Rockscout wrote:What's the correct script for a little extra extrusion following toolhead movement? I'm using the "don't cross outline" feature which is like a big wipe movement. The long wipe drains the nozzle and leaves a 1 mm void in extrusion at the start of my perimeter layers.
You don't need a script for that. Just use the "extra restart distance" setting. For example, if you make that 0.2mm, it will extrude an extra 0.2mm at the start of each perimeter after doing a retract
Thanks. I'd like this function separate from retraction settings. I'm using a stringy material. I have the ooze control dialed in for no stinging over open spaces. Those retraction settings are just to extreme to happen 6+ times on every layer. It unnecessarily stresses the stepper, the stepper driver, and causes clogs and thin layers, using those settings for all retractions.
So if there is a way to do an extra restart with a script I would like to know.
I realize I could do separate processes, with separate ooze control setting for different layers of the print, but again, the script, if there is one, would make a more elegant solution.
codexmas
Posts: 3
Joined: Sun Jun 26, 2016 1:18 pm

Re: Tip of the Day 8- Scripts tab, G-Code

The replacements are amazing!

I have had an issue with my initial print wipe/purge routine where after the wipe and purge the print starts, but it does a retraction right away causing the initial brim/skirt to be starved and not grab well.

I used this:
{REPLACE "M117 Printing...\nG92 E0\nG1 E-2.5000 F1800" "M117 Printing...\nG92 E0\n;First Retraction Removed"}

The ability to do multi-line search and replace for the search parameter and the replacement is very powerful.

Now my wipe/purge routine will ooze on it's way to the perimeter which is what I had intended from the beginning :)

Return to “General Discussion and Tips”