Network nodes flexscript

Network nodes flexscript

10Dulkar
Not applicable
15 Views
4 Replies
Message 1 of 5

Network nodes flexscript

10Dulkar
Not applicable

[ FlexSim 22.1.4 ]

hello.


i have more than 2000 network nodes and I created, connected and made them one way using program. however I have to now change speed, spacing and connection type ( non-passing) using a program but I am unable to find the command for it. Can anyone please help how to get this done using script?


@Matthew Gillespie @Logan Gold @Joerg Vogel

0 Likes
Accepted solutions (1)
16 Views
4 Replies
Replies (4)
Message 2 of 5

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

Those three settings are subnodes of the connection between two nodes. Here's an example of setting those three settings for all the out connections of a single network node:

treenode netNode = Model.find("NN1");
var connects = connectionsout(netNode).subnodes;
for (int i = 1; i <= connects.length; i++) {
    treenode connection = connects;
    connection.find("maxSpeed").value = 1;
    connection.find("spacing").value = 1;
    connection.find("connectionType").value = 3;
}


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 5

10Dulkar
Not applicable

thank you Matthew. this helps.

0 Likes
Message 4 of 5

joerg_vogel_HsH
Mentor
Mentor
You need to check which edge you want to change values for. If you do this on all network nodes and at each edge you will deactivate you network at all.
0 Likes
Message 5 of 5

jason_lightfootVL7B4
Autodesk
Autodesk

To make the connection type easier to read you can use EDGE_NONPASSING instead of '3' and to make it one way use EDGE_NOCONNECTION. To restore passing use EDGE_PASSING