question

Ranggi M avatar image
0 Likes"
Ranggi M asked Connor A commented

How to write Rack, Bay,Level of storable rack?

Hi,

Im searching oh ways to write all the available storage object in my model.

I use some object connected to all the rack in my model and put this code to the said object :

int loop = 0;

for(int rack = 1; rack<= current.outObjects.length; rack++ ){

for(int bay = 1; bay<= rackgetnrofbays(current.outObjects[rack]) ; bay++){

for(int lvl = 1; lvl <= rackgetnroflevels(current.outObjects[rack]); lvl++){

loop++;

Table("Pallet_Unloading").addRow(0,0);

Table("Pallet_Unloading")[Table("Pallet_Unloading").numRows][1] = current.outObjects[rack].name;

Table("Pallet_Unloading")[Table("Pallet_Unloading").numRows][2] = bay;

Table("Pallet_Unloading")[Table("Pallet_Unloading").numRows][3] = lvl;

}


}

}

}


I write to "Table Unloading", the problem is, I only want to write the storable storage, I believe this is possible using the attribut of rack isStorable = 1. And I try to add this code :

if(Model.find(current.outObjects[rack].name+">variables/bays/"+bay+"/levels/"+lvl+"/isStorable") = 1){}

It doesn't work because Im getting the node and not the value of the node (the int number 1 for "storable" and 0 "non storable). How can I get the value of this isStorable?

Thank you


FlexSim 19.2.4
global tablerackcodeisstorable
· 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.

Connor A avatar image Connor A commented ·

Hi @Ranggi M, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

To get the value of a node simply add ".value" behind the reference to the node.

if(Model.find(...).value == 1)

You could also iterate through the actual Storage.Bay/Level/Slot class objects which offer the number of "sub-classes" and other useful values as easily accessible properties.

The code of the default "Slot Assignment Strategy" of a rack is a decent example for this.

1632912893140.pngProperties for the Storage.Slot class can be found here:

https://docs.flexsim.com/en/19.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storage.Slot.html


1632912893140.png (31.9 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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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