Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: enzo_87 on July 28, 2021, 12:39:28 PM

Title: expression for changing index value
Post by: enzo_87 on July 28, 2021, 12:39:28 PM
Good morning everyone,

I'm trying to setup a parametric window.
following a tutorial, I saw it's possible to change index with an expression.
reading the help manual, I adapted the expression in this way:

if(XSplinePosition==0,3,
if(XSplinePosition==1,1,
2));

so as to have an element at the start, one at the end, and one elsewhere in the Y evenly.

What am I doing wrong?

Thanks in advance,
Lorenzo
Title: Re: expression for changing index value
Post by: Paul Roberts on July 28, 2021, 02:26:55 PM
Hi Lorenzo,

There have been a few changes to the expressions syntax since that tutorial was recorded. Now it is necessary to add the word Return before the expressions to tell RailClone that this is the value you wish to output. Your expression should read

return if(XSplinePosition==0,3,
if(XSplinePosition==1,1,
2));


That said, there is a new macro in RailClone that is much easier to use than the approach show in this older tutorial. You can learn more about it in this video that we released last week.


I hope that helps,
Paul
Title: Re: expression for changing index value
Post by: enzo_87 on July 28, 2021, 03:41:30 PM
Thank you Paul,
The macro is a life safer.

Thanks also for helping me out with the expression, I didn't know where to find the trouble, evaluating the expression was sayong that was correct.
Thanks a lot.

Lorenzo