Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: cc8boy on March 24, 2021, 10:08:54 PM

Title: HOW TO USE ‘OR’ AND ‘AND’ OF ‘IF’ CONDITIONAL STATEMENT IN EXPRESSION NODE ?
Post by: cc8boy on March 24, 2021, 10:08:54 PM
Hello developers of itoosoft,
How to use ‘OR’ and ‘AND’ of ‘IF’ conditional statement in expression node ?
Is any loop statements in expession node ? What language is based on this expession ? Javascript ?
I can’t find it in ‘railclone_documentation.pdf’.
Could you please show me some example about ‘SegmentXRole’ in expression node ?
I don’t understand how to use this ‘SegmentXRole’ value.
I can’t find any tutorial or example in this website or ‘railclone_documentation.pdf’.

Is it possible to print out some values (to debug) in the expression nodes ?
Could you please help me ?
MAX2014/RC 3.10 :'(
Title: Re: HOW TO USE ‘OR’ AND ‘AND’ OF ‘IF’ CONDITIONAL STATEMENT IN EXPRESSION NODE ?
Post by: Rokas on March 25, 2021, 09:34:01 AM
Hi

OR is | operator
AND is & operator
More about arithmetic operator You can find in our documentation (https://docs.itoosoft.com/railclone/style-editor/operators#Operators-Arithmetic) page.

There are no loop statements.

segmentxRole can be used on segments before passing them to macro, when in that macro it is used multiple times.
Example there is a macro in which the same segment is used 3 times- on start, end and in evenly.
On Top Level style editor, before passing this segment to the macro I have added this Z size modification:
Code: [Select]
return if(SegmentXRole==4, 50, 10);Which means, if segment is in evenly input, make it 50 units tall, if not- 10 units tall.

(https://i.imgur.com/jfNCxJQ.png)

It is possible to print debug values with print command, but it wont always be super helpful all the time, especially when those statements include railclone parameters.
I generally like to change some segments Z size depending on the expression i am writing to get a sense of what is going on.

Hope this helps.
Title: Re: HOW TO USE ‘OR’ AND ‘AND’ OF ‘IF’ CONDITIONAL STATEMENT IN EXPRESSION NODE ?
Post by: cc8boy on March 25, 2021, 09:40:43 AM
This is really help. Thank you very much Rokas.
Title: Re: HOW TO USE ‘OR’ AND ‘AND’ OF ‘IF’ CONDITIONAL STATEMENT IN EXPRESSION NODE ?
Post by: cc8boy on March 25, 2021, 11:59:59 AM
Hi

OR is | operator
AND is & operator
More about arithmetic operator You can find in our documentation (https://docs.itoosoft.com/railclone/style-editor/operators#Operators-Arithmetic) page.

There are no loop statements.

segmentxRole can be used on segments before passing them to macro, when in that macro it is used multiple times.
Example there is a macro in which the same segment is used 3 times- on start, end and in evenly.
On Top Level style editor, before passing this segment to the macro I have added this Z size modification:
Code: [Select]
return if(SegmentXRole==4, 50, 10);Which means, if segment is in evenly input, make it 50 units tall, if not- 10 units tall.

(https://i.imgur.com/jfNCxJQ.png)

It is possible to print debug values with print command, but it wont always be super helpful all the time, especially when those statements include railclone parameters.
I generally like to change some segments Z size depending on the expression i am writing to get a sense of what is going on.

Hope this helps.
Did you mean if I leave the 'Start input'  and 'End input' empty (nothing connect to these two inputs)  of one Linear 1S generator, this 'segmentxRole' will not find the first and the last segments of the 'Defaut Input' ?
Title: Re: HOW TO USE ‘OR’ AND ‘AND’ OF ‘IF’ CONDITIONAL STATEMENT IN EXPRESSION NODE ?
Post by: Rokas on March 25, 2021, 01:42:29 PM
Did you mean if I leave the 'Start input'  and 'End input' empty (nothing connect to these two inputs)  of one Linear 1S generator, this 'segmentxRole' will not find the first and the last segments of the 'Defaut Input' ?
No I have not meant that.
I meant that in this RailClone style if segment goes to generators evenly input, it gets scaled to 50 units high, if not- 10 units high.
So if You disconnect start and end inputs, You will have 3 tall boxes standing in the middle of the spline:
(https://i.imgur.com/Q6ot1HA.png)
Title: Re: HOW TO USE ‘OR’ AND ‘AND’ OF ‘IF’ CONDITIONAL STATEMENT IN EXPRESSION NODE ?
Post by: cc8boy on March 25, 2021, 02:16:49 PM
OK, Now I understand this 'segmentxRole' is for finding 'Start input'  and 'End input' segments not for finding the first segments and the last segments of 'default Input'.

Now I have very simple question. How to find the actual the first and the last of 'evenly input' or 'default input' in one section of the spline ?
Especailly the first and the last in the  'evenly input'.

I tried to analysis the macro named 'Scale final X seg'. It seems that it can only compare the length of the remain position of the segment to the size of the segment to judge if it is the end segment
Is there a straight forward way to find the first and the last default or evenly segment in one section ?
Title: Re: HOW TO USE ‘OR’ AND ‘AND’ OF ‘IF’ CONDITIONAL STATEMENT IN EXPRESSION NODE ?
Post by: Rokas on March 25, 2021, 02:25:51 PM
Now I have very simple question. How to find the actual the first and the last of 'evenly input' or 'default input' in one section of the spline ?
Especailly the first and the last in the  'evenly input'.
I don't know.