question

chao.g avatar image
3 Likes"
chao.g asked Brandon Peterson edited

Automatically create port connections

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?

connectionsselected objectsportsobjectsscripting
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Ben Wilson avatar image
5 Likes"
Ben Wilson answered Ben Wilson edited

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.

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");

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.