question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Ankur A3 commented

Imported Timetable Not Working?

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!

FlexSim 21.0.10
excelimporttimetable
1657781736593.png (26.0 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 Ankur A3 commented

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;
}
· 1
5 |100000

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

Ankur A3 avatar image Ankur A3 commented ·
Thank you @Felix Möhlmann
0 Likes 0 ·