Itoo Software Forum

Author Topic: expression for changing index value  (Read 388 times)

enzo_87

  • Newbie
  • *
  • Posts: 39
    • www.lorenzospinola.com
expression for changing index value
« 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

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1990
Re: expression for changing index value
« Reply #1 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
Paul Roberts
iToo Software

enzo_87

  • Newbie
  • *
  • Posts: 39
    • www.lorenzospinola.com
Re: expression for changing index value
« Reply #2 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