question

Nivedita Ravi avatar image
1 Like"
Nivedita Ravi asked Arun Kr commented

How do I check the contents of an object?

How do I check the contents of an object (a tote) and make a decision based on it?

FlexSim 16.2.2
objectcontent
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

Arun Kr avatar image
2 Likes"
Arun Kr answered Arun Kr commented

Hi Nivedita Ravi,

Since the FlexSim version you are using is FlexSim 16 you have to use the command called content() along with an if structure to make a decision. I have also given the solution for FlexSim 17 version.

In FlexSim 16 Version
treenode Queue= node("Queue",model());//Object is a Queue for example with name "Queue"
treenode Tote = first(Queue);// Suppose Tote is the first ranked object in the Queue 
if(content(Tote)<=5) //Decision made based on Tote's content
{
colorred(Queue)//Colour changed to red colour
}

In FlexSim 17 Version using Dot Syntax

Object Queue = model().find("Queue")//Object is a Queue for example
Object Tote = Queue.first;// Suppose Tote is the first ranked object in the Queue 
if(Tote.subnodes.length<=5) //Decision made based on Tote's content
{
colorred(Queue)//Colour changed to red colour
}

Regards,

Arun KR

· 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.

Joerg Vogel avatar image Joerg Vogel commented ·
Queue.color = Color.red // dot syntax

;-)

3 Likes 3 ·
Arun Kr avatar image Arun Kr Joerg Vogel commented ·

Thanks @Jörg Vogel.

1 Like 1 ·