How to implement multi-port switch via C-script or other methods?

I wonder how to implement multi-port switch in plecs ,what it is look like is as follows:

I wonder whether I can use C-script to realize it? Can anyone help me ?

Hello,

You can simply use the “Signal Selector” block for this purpose. Please see the attached example.

Regards,
Manu

signal_select.plecs (12.4 KB)