<?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: How do I find a slot ordered by distance to an object in the model? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-find-a-slot-ordered-by-distance-to-an-object-in-the/m-p/13540549#M47443</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 Thanks, that was easy.
&lt;/DIV&gt;</description>
    <pubDate>Thu, 17 Feb 2022 18:16:43 GMT</pubDate>
    <dc:creator>jamesriebau</dc:creator>
    <dc:date>2022-02-17T18:16:43Z</dc:date>
    <item>
      <title>How do I find a slot ordered by distance to an object in the model?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-find-a-slot-ordered-by-distance-to-an-object-in-the/m-p/13540547#M47441</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 22.0.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello,&lt;/P&gt;
 &lt;P&gt;In my warehouse model I'm working on I'm trying to prioritize which slots are chosen to put pallets away in floor storage. I would like to order the slots by closest to the docks.&lt;/P&gt;
 &lt;P&gt;In my find slot task was trying to reverse engineer the query for ‘ORDER By Distance from Object', to change the object from current pallet to another object in the model, but I really don't have a clue how to do it. I placed a cylinder in the center of my docks that I want to use as my object to measure from.&lt;/P&gt;
 &lt;P&gt;Can anyone help me with this?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="screenshot-2022-02-17-115805.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1508999i79DD3A97399CB803/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot-2022-02-17-115805.jpg" alt="screenshot-2022-02-17-115805.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Thanks,&lt;/P&gt;
 &lt;P&gt;Jim&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/48710-putawaytest.fsm" target="_blank"&gt;PutawayTest.fsm&lt;/A&gt; &lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Feb 2022 17:24:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-find-a-slot-ordered-by-distance-to-an-object-in-the/m-p/13540547#M47441</guid>
      <dc:creator>jamesriebau</dc:creator>
      <dc:date>2022-02-17T17:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find a slot ordered by distance to an object in the model?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-find-a-slot-ordered-by-distance-to-an-object-in-the/m-p/13540548#M47442</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You can add a second parameter and use the sampler to point it to the cylinder&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1645120122782.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1508996i75B6E5450038079F/image-size/large?v=v2&amp;amp;px=999" role="button" title="1645120122782.png" alt="1645120122782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- then you can use:&lt;/P&gt;&lt;PRE&gt;WHERE slot.Part == 0 AND slot.zoneID == $1.StorageGroup AND slot.hasSpace($1) ORDER BY (slot.location.project(slot.storageObject, model()) - $2.as(Object).location.project($2.up, model())).magnitude ASC&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Or you can add a label on the item pointing to the cylinder and reference $1.yourlabel instead of $1 in the distance part:&lt;/P&gt;&lt;PRE&gt;WHERE slot.Part == 0 AND slot.zoneID == $1.StorageGroup AND slot.hasSpace($1) ORDER BY (slot.location.project(slot.storageObject, model()) - $1.yourlabel.as(Object).location.project($1.yourlabel.up, model())).magnitude ASC&lt;/PRE&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/48737-putawaytest-jl.fsm" target="_blank"&gt;putawaytest_jl.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Feb 2022 17:42:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-find-a-slot-ordered-by-distance-to-an-object-in-the/m-p/13540548#M47442</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2022-02-17T17:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find a slot ordered by distance to an object in the model?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-find-a-slot-ordered-by-distance-to-an-object-in-the/m-p/13540549#M47443</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thanks, that was easy.
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Feb 2022 18:16:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-find-a-slot-ordered-by-distance-to-an-object-in-the/m-p/13540549#M47443</guid>
      <dc:creator>jamesriebau</dc:creator>
      <dc:date>2022-02-17T18:16:43Z</dc:date>
    </item>
  </channel>
</rss>

