Page 1 of 1

SEND TO n° 6 with adjustment

Posted: Monday 17 March, 2014 - 12:48
by Spaggio86
Hallo everyone!!!!

Just a simple question. I have a queqe with a particular way to manage the products inside. I use the "send to" function number 6 (By atom name:if the atom name of the 1st atom in the queue matches "XXX" than send to channel 1 else 2) but I have to make a change. I want the atoms different by "XXX" are sent in channel 2 or 3 or 4 randomly...

What can I have to do to reach my purpose?

Thanks in advance!!!

Re: SEND TO n° 6 with adjustment

Posted: Monday 17 March, 2014 - 15:04
by Nick
Hi Spaggio86,

The predefined logic you selected uses the following 4DScript code:

Code: Select all

if(CompareText(Name(Rank(1,c)),[AtomName]),1,2)
You can use the function dUniform to generate a random discrete value between 2 and 4.
In other words, if the atom name of the 1st atom in the queue doesn't match "XXX", then use dUniform(2,4)

Regards, Nick

Re: SEND TO n° 6 with adjustment

Posted: Tuesday 18 March, 2014 - 09:57
by Spaggio86
Thanks Nick, i used that code with the dUniform distribution and it works!!!

I start to understand this language...