Page 1 of 1

More than 1 line in an [if] gcode statement?

Posted: Wed Nov 24, 2021 1:05 pm
by nesdnuma
Hello,

I want to trigger several gcode commands from an [if] statement in the Layer change gcode. The code example explains how to insert only a single line of code after the [if]. Is it possible to insert several lines? What's the syntax, then?

Thank you.

Re: More than 1 line in an [if] gcode statement?

Posted: Wed Nov 24, 2021 10:57 pm
by nesdnuma
I don't know if my first message is clear.

So here's another way to ask.

The example given for if is as follows:
[if condition] command;

What I want is something like this:
[if condition]
command 1;
command 2;
...
command n;
[endif]

Re: More than 1 line in an [if] gcode statement?

Posted: Thu Nov 25, 2021 11:41 am
by nesdnuma
Isn't it possible?

Re: More than 1 line in an [if] gcode statement?

Posted: Tue Nov 30, 2021 10:54 pm
by Ryan@Raise3D
you can do 1 if condition per command, but you can do multiple if conditions as shown below
[if condition]
command 1;

[if condition]
command 2;

Re: More than 1 line in an [if] gcode statement?

Posted: Wed Dec 01, 2021 12:36 pm
by nesdnuma
That makes sense. I'll try that. Will the different lines be encoded in the written order?

Re: More than 1 line in an [if] gcode statement?

Posted: Wed Dec 01, 2021 10:56 pm
by Ryan@Raise3D
Yes they will be.