<?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 Re: Packed Pallets in Racking in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523787#M34090</link>
    <description>&lt;P&gt;Apparently being stuck at home in a blizzard leads to me solving my own problems &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I updated the Slot Assignment Strategy code as follows:&lt;/P&gt;
&lt;PRE&gt;Storage.Object current = ownerobject(c);
Object item = param(1);
Storage.Item storageItem = Storage.Item(item);
/***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;;
			if (slot.slotItems.length == 0) {
				storageItem.assignedSlot = slot;
				return 0;
			}
		}
	}
}


&lt;/K&gt;&lt;/J&gt;&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;Attached is an updated model that works correctly.&lt;/P&gt;
&lt;P&gt;&lt;A id="25047" href="https://answers.flexsim.com/storage/attachments/25047-racking-small-pallets-fixed.fsm"&gt;racking-small-pallets-fixed.fsm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jan 2020 02:55:47 GMT</pubDate>
    <dc:creator>jason_vore</dc:creator>
    <dc:date>2020-01-18T02:55:47Z</dc:date>
    <item>
      <title>Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523786#M34089</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 20.0.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;When packing boxes on a pallet with a combiner and then sending them to a rack, the pallets stack on top of each other in the slots rather than moving to a new slot. It's like the function to check if there is room in the slot is only checking for the pallet dimensions rather than the dimensions of the contents as well.&lt;/P&gt;
&lt;P&gt;Interestingly, I've had it randomly work the way I would expect, but have not been able to find a logical explanation for why.&lt;/P&gt;
&lt;P&gt;Is it possible to have the slot assignment strategy be First Empty Slot rather than First Slot with Space?&lt;/P&gt;
&lt;P&gt;I've attached a simple sample that mimics the issue.&lt;/P&gt;
&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;
&lt;P&gt;&lt;A id="25045" href="https://answers.flexsim.com/storage/attachments/25045-racking-small-pallets.fsm"&gt;racking-small-pallets.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 02:10:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523786#M34089</guid>
      <dc:creator>jason_vore</dc:creator>
      <dc:date>2020-01-18T02:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523787#M34090</link>
      <description>&lt;P&gt;Apparently being stuck at home in a blizzard leads to me solving my own problems &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I updated the Slot Assignment Strategy code as follows:&lt;/P&gt;
&lt;PRE&gt;Storage.Object current = ownerobject(c);
Object item = param(1);
Storage.Item storageItem = Storage.Item(item);
/***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;;
			if (slot.slotItems.length == 0) {
				storageItem.assignedSlot = slot;
				return 0;
			}
		}
	}
}


&lt;/K&gt;&lt;/J&gt;&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;Attached is an updated model that works correctly.&lt;/P&gt;
&lt;P&gt;&lt;A id="25047" href="https://answers.flexsim.com/storage/attachments/25047-racking-small-pallets-fixed.fsm"&gt;racking-small-pallets-fixed.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 02:55:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523787#M34090</guid>
      <dc:creator>jason_vore</dc:creator>
      <dc:date>2020-01-18T02:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523788#M34091</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/19492/jasonv2.html" nodeid="19492"&gt;@Jason V2&lt;/A&gt;, there exists several other approaches to this dilemma. The source code of this function is just an example to introduce the structure of bay, level and slot to users. We discussed this function at least at three different questions in the past months since the releasing of warehousing module. The method findSlot does the same as the changed default code in just a single short line of code&lt;/P&gt;&lt;P&gt;The SQL clause condition is a parameter string therein: &lt;/P&gt;&lt;PRE&gt;WHERE slot.slotItems.length &amp;lt; 1&lt;/PRE&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/answers/76833/view.html" target="_blank"&gt;Anthony Johnson has presented this method with similar conditions and combinations.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Seung Yong Seo discussed your question first at&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;A href="https://answers.flexsim.com/questions/75326/a-difference-when-storing-a-container-item-and-a-b.html"&gt;A difference when storing a container item and a basic item&lt;/A&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The method hasSpace checks indeed only the size of the most upper item of a container structure. This leads to a dynamic size adjustment of container item, that stores packed items into a sub node pallet and adjust the height OnPalletEntry to the maximum dimension value in z direction of all stored items in the container sub structure. OnExit event the dimension is adjusted again. &lt;BR /&gt;If you use this new structured pallet, you must change the standard references to the packed items on your own. &lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 04:27:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523788#M34091</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-01-18T04:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523789#M34092</link>
      <description>&lt;P&gt;Jorg,&lt;/P&gt;
&lt;P&gt;Thanks for the reply. I did a lot of searching, but wasn't able to find those previous answers.&lt;/P&gt;
&lt;P&gt;Thanks a ton!&lt;/P&gt;
&lt;P&gt;Jason&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 17:06:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523789#M34092</guid>
      <dc:creator>jason_vore</dc:creator>
      <dc:date>2020-01-18T17:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523790#M34093</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;I was able to condense my code down to the following thanks to the references you provided:&lt;/P&gt;
 &lt;PRE&gt;/**Custom Code*/
Storage.Object current = ownerobject(c);
Object item = param(1);
Storage.Item(item).assignedSlot = Storage.system.findSlot("WHERE slot.slotItems.length &amp;lt; 1 ORDER BY slot.bayID ASC, slot.levelID ASC");&lt;/PRE&gt;
 &lt;P&gt;Moderator comment:&lt;/P&gt;
 &lt;P&gt;It looks like others are copying this code. It will not filter on the storage object 'current' where the assignment strategy sits, therefore can return slots for other objects. To rectify this you need to add to the WHERE clause:&lt;/P&gt;
 &lt;PRE&gt;AND slot.storageObject=$1&lt;/PRE&gt;
 &lt;P&gt;and pass in 'current' as parameter 2.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 18 Jan 2020 17:17:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523790#M34093</guid>
      <dc:creator>jason_vore</dc:creator>
      <dc:date>2020-01-18T17:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523791#M34094</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Jason, I copied your condensed code version and it doesn't work for me.  After the 1st pallet enters the rack I get the error "No slot was assigned to item".&lt;/P&gt;&lt;P&gt;I can't find the problem.  Did it work for you exactly as is?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Oct 2022 20:09:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523791#M34094</guid>
      <dc:creator>patrickABAWF</dc:creator>
      <dc:date>2022-10-05T20:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523792#M34095</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/240/patrick.c.html" nodeid="240"&gt;@Patrick Cloutier&lt;/A&gt; , can you provide us a version, you have tested this code, just in case it might be a bug. Thank you, Patrick.&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Oct 2022 02:24:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523792#M34095</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2022-10-06T02:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523793#M34096</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;If you have more than one rack you may have assigned the item a slot in a different rack - the condensed code searches the whole storage system as no reference is being made to the storage object '&lt;EM&gt;current' &lt;/EM&gt;in the query.&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Oct 2022 09:42:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523793#M34096</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2022-10-06T09:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523794#M34097</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;That was my problem. I had another rack in the model and so the above code didn't work. I just removed the other rack and now it works.  BUT if the other racks are added after this rack, then it works.  So as long as the rack I'm putting this code in is the first rack in the system, it works for it.&lt;/P&gt;&lt;P&gt;I guess I could figure out how to make a reference to "current" and make it work with many racks.  But then I'd be stuck with copying that in every rack.  And what if I want to find a slot within a bunch of racks or all racks.&lt;/P&gt;&lt;P&gt;I'm using 22.2.2. I seem to remember it wasn't like that with the older rack object. We had a menu where we could specify how many items per slot. In Place in Bay/Level perhaps?  I don't remember but I know I have a model built in 2019 that no longer works because of that.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Oct 2022 12:08:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523794#M34097</guid>
      <dc:creator>patrickABAWF</dc:creator>
      <dc:date>2022-10-06T12:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523795#M34098</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Just to clarify: My goal here is to have a model that automatically places one and only one pallet per slot. It used to be like that automatically in 2019 with no code.&lt;/P&gt;&lt;P&gt;The problem of having to find a slot through one or many racks is a different issue irrelevant to this post.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Oct 2022 12:37:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523795#M34098</guid>
      <dc:creator>patrickABAWF</dc:creator>
      <dc:date>2022-10-06T12:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523796#M34099</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You may be able to do that with the standard slot assignment code and disallow stacking in Y and Z:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1665062863687.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501113iDE265664F8ED0A46/image-size/large?v=v2&amp;amp;px=999" role="button" title="1665062863687.png" alt="1665062863687.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It will depend on the width of your slots.&lt;/P&gt;&lt;P&gt;You can also refer to the slot's storage object in the where clause of a findSlot query.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/59381-rackstackingconstraint.fsm" target="_blank"&gt;rackStackingConstraint.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Oct 2022 13:27:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523796#M34099</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2022-10-06T13:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Packed Pallets in Racking</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523797#M34100</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Wow that works (slot stacking = none). I don't think I would have been able to figure that out.&lt;/P&gt;&lt;P&gt;I actually need it to be 2 or 3 pallets per shelf depending on the shelf width so it works great now.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Oct 2022 17:25:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/packed-pallets-in-racking/m-p/13523797#M34100</guid>
      <dc:creator>patrickABAWF</dc:creator>
      <dc:date>2022-10-06T17:25:00Z</dc:date>
    </item>
  </channel>
</rss>

