question

10Dulkar avatar image
0 Likes"
10Dulkar asked Jason Lightfoot edited

Network nodes flexscript

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

FlexSim 22.1.4
network nodes
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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Jason Lightfoot edited

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[i];
    connection.find("maxSpeed").value = 1;
    connection.find("spacing").value = 1;
    connection.find("connectionType").value = 3;
}
· 3
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

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

1 Like 1 ·
10Dulkar avatar image 10Dulkar commented ·

thank you Matthew. this helps.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·
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 0 ·