How to copy connections (upstream and downstream) of an area in the flowchart to a new area?

How to copy connections (upstream and downstream) of an area in the flowchart to a new area?

AHashemloo
Participant Participant
18 Views
2 Replies
Message 1 of 3

How to copy connections (upstream and downstream) of an area in the flowchart to a new area?

AHashemloo
Participant
Participant

[ FlexSim HC 5.1.0 ]

Hello,

Using Flexsim Healthcare, I was wondering if there is a script that I can use to copy all connections (upstream and downstream) of an area in the flowchart to a new area. Such feature allows for not adding several identical connections manually for new areas in the flow chart.

Thank you,

Alireza

0 Likes
Accepted solutions (1)
19 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

Here's an example model and here's the script:

treenode area1 = node("BedArea", AreasNode);
treenode area2 = node("ComputerTableArea", AreasNode);

for(int i = 1; i <= nrop(area1); i++)
{
	treenode otherArea = node("+/~", rank(connectionsout(area1), i));
	contextdragconnection(area2, otherArea, "A");
}

for(int i = 1; i <= nrip(area1); i++)
{
	treenode otherArea = node("+/~", rank(connectionsin(area1), i));
	contextdragconnection(otherArea, area2, "A");
}

TransferAreaConnections();


Matthew Gillespie
FlexSim Software Developer

Message 3 of 3

AHashemloo
Participant
Participant

@Matthew Gillespie Thank you! I tested the script on a current project file for a couple of areas and did not encounter any issues. This is very useful.

On a side note, I was wondering if it is possible to have the capability for selecting a number of areas in the scene as a list and making connections so that any given area in the selection list is connected with all other areas in the same selection set? This will be particularly helpful to avoid missing connections for larger and more complex simulation scenes. I do not know whether having "too many" connections between areas in the flowchart would impact the model's performance or not.

0 Likes