Send to specific channels

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Lange
Posts: 1
Joined: Monday 14 April, 2014 - 15:34

Send to specific channels

Post by Lange »

Hi all,

I'm stuck with my little project.
I want to send a Atom from a Source to specifc channels.
For example from a Source send to channel 1,3 and 6.
But i want to keep the other output channels.

What is the best way to do this?

Kind regards!
adelhaye
Posts: 3
Joined: Monday 14 April, 2014 - 10:15

Re: Send to specific channels

Post by adelhaye »

Hi Lange.
To do this, you can add custom 4DScript to the attribute "send to" of your Source.

If you want to choose a random chanel between 1, 3 or 6, you can set the attribute "send to" like this :

Code: Select all

Bernoulli(33,1,Bernoulli(50,3,6))
With this code, the same quantity of products will go to channel 1, 3 and 6.

If can also choose the chanell according to a parameter or a label :

Code: Select all

if(Label([LabelName], first(c)) < 1, 1, if(Label([LabelName],first(c)) > 10, 3, 6) )
With this exemple, if the label "LabelName" value is < to 1, the ouput chanel will be 1. If the value is < 10, output will be 3. Else (1 <= value <= 10), output will be 6.

Antoine
Post Reply