question

Sean avatar image
0 Likes"
Sean asked Felix Möhlmann answered

duplicate control point connection list

Hi,

I duplicate control point connection list. But there isn't any value in list. Is there any way except connect control point again? Thank's.list-duplicate.png

FlexSim 22.2.3
global lists
list-duplicate.png (40.5 KiB)
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

Populating that list is probably handled by some internal logic that is not directly (at least not easily) accessible.

As a workaround you can run the code below when the model starts to copy all entries to the second list. For example by putting in a small process flow block that creates a token at time 0.

1668072182547.pngI tested the code with "Location" connections. It should work the same with the DropoffPoints, but you have to adjust the path in line 1 and the list name in line 2.

treenode listPartitions = Model.find("/Tools/GlobalLists/Location>variables/partitions");
List copy = List("Location_2");
for(int i = 1; i <= listPartitions.subnodes.length; i++)
{
    treenode partition = listPartitions.subnodes[i];
    treenode value = getsdtvalue(partition, "id");
    treenode entries = partition.subnodes[1];
    for(int j = 1; j <= entries.subnodes.length; j++)
    {
        copy.push(entries.subnodes[j].value, value);
    }
}

1668072182547.png (5.6 KiB)
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.