Adding Members to Timetable Dynamically/Command (HC)

Adding Members to Timetable Dynamically/Command (HC)

michael_smith4
Not applicable
42 Views
3 Replies
Message 1 of 4

Adding Members to Timetable Dynamically/Command (HC)

michael_smith4
Not applicable

[ FlexSim HC 5.0.12 ]

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?

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

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

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:

treenode members = getvarnode(timeTable, "members");
treenode objPointer = assertsubnode(members, name, DATATYPE_COUPLING);

treenode tables = assertvariable(obj, "timetables", DATATYPE_STRING);
treenode tablePointer = assertsubnode(tables, getname(timeTable), DATATYPE_COUPLING);

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.



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 4

elizabeth_lopez
Not applicable

What about removing a member from a time table?

0 Likes
Message 4 of 4

Matthew_Gillespie
Autodesk
Autodesk

Just delete one of the subnodes on either end. So on the member you could find the correct timetable in its timetables variable and delete that subnode, or on the timetable find the correct member in its members variables and delete that subnode.



Matthew Gillespie
FlexSim Software Developer

0 Likes