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

Discussions about ideaMaker and other printing software.
nesdnuma
Posts: 8
Joined: Wed Nov 24, 2021 1:00 pm

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

Postby nesdnuma » Wed Nov 24, 2021 1:05 pm

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.

nesdnuma
Posts: 8
Joined: Wed Nov 24, 2021 1:00 pm

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

Postby nesdnuma » Wed Nov 24, 2021 10:57 pm

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]

nesdnuma
Posts: 8
Joined: Wed Nov 24, 2021 1:00 pm

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

Postby nesdnuma » Thu Nov 25, 2021 11:41 am

Isn't it possible?

User avatar
Ryan@Raise3D
Posts: 85
Joined: Thu Oct 28, 2021 10:43 pm

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

Postby Ryan@Raise3D » Tue Nov 30, 2021 10:54 pm

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;

nesdnuma
Posts: 8
Joined: Wed Nov 24, 2021 1:00 pm

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

Postby nesdnuma » Wed Dec 01, 2021 12:36 pm

That makes sense. I'll try that. Will the different lines be encoded in the written order?

User avatar
Ryan@Raise3D
Posts: 85
Joined: Thu Oct 28, 2021 10:43 pm

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

Postby Ryan@Raise3D » Wed Dec 01, 2021 10:56 pm

Yes they will be.


Return to “Software”

Who is online

Users browsing this forum: No registered users and 1 guest