question

michael.smith avatar image
0 Likes"
michael.smith asked Matthew Gillespie commented

Adding Members to Timetable Dynamically/Command (HC)

I need to add specific staff members to a variety of timetables based on data loaded into the model. I can see in the tree that the reference is held in both the Timetable and the Object (Staff Member) I've also had a look inside the TimeTable Object code but I'm not sure exactly how to use the add functions. Is there a simple way to add the objects? Can I add the reference (Staff Name) to the Timetable Object?

FlexSim HC 5.0.12
codetimetablecommandcommand line
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 Matthew Gillespie commented

Here is the path to the code that's run when you add a member to the shift schedule member list:

VIEW:/standardviews/modelingutilities/QuickProperties>variables/propertiesPanels/

ShiftScheduleMembers/ShiftScheduleMembers/ButtonPanel/Add>eventfunctions/addMember

Here's the core of that code:

  1. treenode members = getvarnode(timeTable, "members");
  2. treenode objPointer = assertsubnode(members, name, DATATYPE_COUPLING);
  3.  
  4. treenode tables = assertvariable(obj, "timetables", DATATYPE_STRING);
  5. treenode tablePointer = assertsubnode(tables, getname(timeTable), DATATYPE_COUPLING);
  6.  
  7. nodejoin(objPointer, tablePointer);

Basically you just need to add a coupling subnode to the members variable of the shift schedule and a coupling subnode to the time tables variable of the object and then join them together.

· 2
5 |100000

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