Automatically create port connections

chao_gao
Not applicable
6 Views
1 Reply
Message 1 of 2

Automatically create port connections

chao_gao
Not applicable

How can I automatically create connections from one object to multiple objects?

In my simulation model, I manually created connections between a queue and many rack objects. It's quite time consuming. I am sure there is an automatic way, maybe using some code in a script to realize this?

Accepted solutions (1)
7 Views
1 Reply
Reply (1)
Message 2 of 2

Ben_Wilson_FS
Community Manager
Community Manager
Accepted solution

Manual Connections

You can manually make multiple connections by connection to or from a group of selected objects. simultaneously by Shift or Ctrl selecting a group of objects (which puts red boxes around them) and then dragging a connection to or from the selection group. All members of the selection group will have the connection made.

65-portconnections-groups.gif

Create Connections Programmatically

You can also make connections programmatically using the command contextdragconnection(). The following sample function call will create an 'A' connection from Source2 to Queue3:

contextdragconnection(node("MODEL:/Source2"), node("MODEL:/Queue3"), "A");