"Enter Area" has been superceded by the new "Allocate Control Area" that utilizes the Control Area object from the AGV/A* category to act as the 'owner' of the area. It thusly allows you to have an interaction between task executers travelling in those networks and items on a conveyor.
If you want to use the old option (I can understand, not needing an extra object is 'neater') you will have to copy the code from an earlier version of FlexSim. I have attached the pickoption code below.
{ //************* PickOption Start *************\\
/***popup:Conveyor_EnterArea*/
/**Enter Restricted Area*/
if (/** \nCondition: *//***tag:condition*//**/true/**/) {
treenode owner = /** \nArea Owner: *//***tag:areaOwner*//**/current.outObjects[1]/**/;
int maxContent = /** \nMax Content: *//***tag:maxContent*//**/1/**/;
// I store area restriction information on the owner's "dp_RestrictedContentArea" label
treenode mutexLabel = owner.labels.assert("dp_RestrictedContentArea", 0);
// if the number of entries is less than the max content...
if (mutexLabel.value < maxContent) {
// increment the number of entries and let the item continue
mutexLabel.value += 1;
} else {
// if the number of entries is at its max, stop the item...
conveyorItem.stop();
// and add a request to the area
mutexLabel.subnodes.add().value = item;
}
}
} //******* PickOption End *******\\
{ //************* PickOption Start *************\\
/***popup:Conveyor_ExitArea*/
/**Exit Restricted Area*/
if (/** \nCondition: *//***tag:condition*//**/true/**/) {
treenode owner = /** \nArea Owner: *//***tag:areaOwner*//**/current/**/;
double delayTime = /** \nDelay Time: *//***tag:delayTime*//**/0/**/;
if (delayTime > 0 && !param(6)) {
delayednodefunction(c, delayTime, param(1), param(2), param(3), 0, 0, 1);
return 0;
}
// I store area restriction information on the owner's "dp_RestrictedContentArea" label
treenode mutexLabel = owner.labels.assert("dp_RestrictedContentArea", 0);
// decrement the number of items in the area
mutexLabel.value = maxof(0, mutexLabel.value - 1);
// if there a requests to enter the area, then let an item in
if (mutexLabel.subnodes.length > 0) {
treenode bestCoupling = mutexLabel.first;
// If I sort by a priority...
int usePriority = /** \nUse Priority: *//***tag:usePriority*//**/0/**/;
if (usePriority) {
double bestPriority = -100000000;
// then search through the request queue and find the request with the highest priority
for (int i = 1; i <= mutexLabel.subnodes.length; i++) {
Object item = mutexLabel.subnodes[i].value;
double priority = /** \nPriority: *//***tag:priority*//**/item.priority/**/;
if (priority > bestPriority) {
bestCoupling = mutexLabel.subnodes[i];
bestPriority = priority;
}
}
}
// get the requesting item
Object item = bestCoupling.value;
Conveyor.Item conveyorItem = item.up.as(Conveyor).itemData[item];
// remove the request
bestCoupling.destroy();
// increment the number in the area
mutexLabel.value += 1;
// resume the item
conveyorItem.resume();
}
}
} //******* PickOption End *******\\