Imported Timetable Not Working?

Imported Timetable Not Working?

rajankur6494
Advocate Advocate
24 Views
2 Replies
Message 1 of 3

Imported Timetable Not Working?

rajankur6494
Advocate
Advocate

[ FlexSim 21.0.10 ]

Hi Team,

I am copying staff's timetable from excel and pasting into timetable object. But it is not working. I tried to check the issue but I can only see the bit formatting difference in the last column. I think the same thing is causing issue.

1657781736593.png

Can you help me how to resolve it?

Thank you!

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

moehlmann_fe
Participant
Participant
Accepted solution

You are likely correct, that the last column is causing the issue. It should contain a pointer to the down behaviour that should be used (can be empty '0x0'). When pasting text into the field, the value is replaced with a string.

Either only paste in the first four columns, leaving the last one at the default empty value if no down behavior is wanted.

Or you can run the following code after copying the values. It will try to find a down behavior with the same name as the text in column 5 and replace the column value with it. (Adjust the table name in the first line to that of the time table you want to update this way.)

string timeTableName = "TimeTable1";
Table timeTable = Model.find("/Tools/TimeTables/" + timeTableName + ">variables/table").as(Table);
for(int row = 1; row <= timeTable.numRows; row++)
{
    string downBehaviorName = timeTable[row][5];
    Object downBehavior = Model.find("Tools/DownBehaviors/" + downBehaviorName);
    timeTable[row][5] = downBehavior;
}
0 Likes
Message 3 of 3

rajankur6494
Advocate
Advocate
Thank you @Felix Möhlmann
0 Likes