<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Stacking Order in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/custom-stacking-order/m-p/13587456#M84129</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 22.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello, I want to change the stacking sequence from left to right, then going up to left to right again and so on for my custom flow item. I attached an image showing that i've complete the first "level" but i coudn't go up any further. Could you guys help me with this?. Any help i'd appreciate it&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1699198797308.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520861iE827E76AE0307728/image-size/large?v=v2&amp;amp;px=999" role="button" title="1699198797308.png" alt="1699198797308.png" /&gt;&lt;/span&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/75605-storing.fsm" target="_blank"&gt;storing.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Sun, 05 Nov 2023 15:47:13 GMT</pubDate>
    <dc:creator>gonzalo4</dc:creator>
    <dc:date>2023-11-05T15:47:13Z</dc:date>
    <item>
      <title>Custom Stacking Order</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-stacking-order/m-p/13587456#M84129</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 22.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello, I want to change the stacking sequence from left to right, then going up to left to right again and so on for my custom flow item. I attached an image showing that i've complete the first "level" but i coudn't go up any further. Could you guys help me with this?. Any help i'd appreciate it&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1699198797308.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520861iE827E76AE0307728/image-size/large?v=v2&amp;amp;px=999" role="button" title="1699198797308.png" alt="1699198797308.png" /&gt;&lt;/span&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/75605-storing.fsm" target="_blank"&gt;storing.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 05 Nov 2023 15:47:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-stacking-order/m-p/13587456#M84129</guid>
      <dc:creator>gonzalo4</dc:creator>
      <dc:date>2023-11-05T15:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Stacking Order</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-stacking-order/m-p/13587457#M84130</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hey &lt;A rel="user" href="https://answers.flexsim.com/users/43381/gonzalo.html" nodeid="43381"&gt;@gonzalo&lt;/A&gt;, you can get your desired outcome by changing the Slot Assignment Strategy. You can customize it a bit by adding a "numItems" and checking that against each slot's number of items. If you find one that has fewer, then save that slot. Assign the slot at the end.&lt;/P&gt;&lt;PRE&gt;Storage.Object current = ownerobject(c);
Object item = param(1);
Storage.Item storageItem = Storage.Item(item);

int numItems = INT_MAX;
Storage.Slot retSlot;
/***popup:SlotByCondition*/
/**First Slot with Space*/
for (int i = 1; i &amp;lt;= current.bays.length; i++) {
  Storage.Bay bay = current.bays&lt;I&gt;;
  for (int j = 1; j &amp;lt;= bay.levels.length; j++) {
    Storage.Level level = bay.levels&lt;J&gt;;
    for (int k = 1; k &amp;lt;= level.slots.length; k++) {
      Storage.Slot slot = level.slots&lt;K&gt;;
      int mustHaveSpace = /**\r\nMust Have Space: *//***tag:mustHaveSpace*//**/1/**/;
      if (!slot.isStorable || (mustHaveSpace &amp;amp;&amp;amp; !slot.hasSpace(item)))
        continue;
      if (slot.slotItems.length &amp;lt; numItems) {
        numItems = slot.slotItems.length;
        retSlot = slot;
      }
    }
  }
}

storageItem.assignedSlot = retSlot;
return 0;
&lt;/K&gt;&lt;/J&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Nov 2023 18:26:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-stacking-order/m-p/13587457#M84130</guid>
      <dc:creator>kavika_faleumu</dc:creator>
      <dc:date>2023-11-06T18:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Stacking Order</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-stacking-order/m-p/13587458#M84131</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thank you very much Kavika. The next thing i'm gonna do is putting a different item before a "level" is completed with the help of an operator. I'll use the process flow to do this. I hope i can do this on my own&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Nov 2023 02:40:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-stacking-order/m-p/13587458#M84131</guid>
      <dc:creator>gonzalo4</dc:creator>
      <dc:date>2023-11-07T02:40:54Z</dc:date>
    </item>
  </channel>
</rss>

