<?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 to change rack slot size according to global table in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550516#M55277</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Here's a user command where you can pass in the rack and the reference of the table like this:&lt;/P&gt;&lt;PRE&gt;configureRackFromTable(Model.find("DK_1"),reftable("WH_MAP"));&lt;/PRE&gt;&lt;P&gt;The code for it is:&lt;/P&gt;&lt;PRE&gt;/**Custom Code*/
Object rack=param(1);
Table table =param(2);
Array loc=[1,1,1];
Array selection = [loc];
function_s(rack, "setNumBays", 1);
function_s(rack, "setNumSlots", 1); //, selection);
function_s(rack, "setNumLevels", 1); //, selection);

int numrows=table.numRows;
//SET COLUMN IDX FOR SPEED
#define BAY 2
#define BAY_WIDTH 3
#define LEVEL 4
#define LEVEL_HEIGHT 5
#define NUMSLOTS 6
function_s(rack, "setNumBays", (table[numrows][BAY]+1)/2);


for (int n=1;n&amp;lt;=numrows;n++) {
&amp;nbsp; &amp;nbsp; double &amp;nbsp;baywidth=table&lt;N&gt;[BAY_WIDTH];
&amp;nbsp; &amp;nbsp; int bay=(table&lt;N&gt;[BAY]+1)/2;
&amp;nbsp; &amp;nbsp; selection=[[bay,1,1]];
&amp;nbsp; &amp;nbsp; function_s(rack, "setBaySize", baywidth,selection);
&amp;nbsp; &amp;nbsp; int level=table&lt;N&gt;[LEVEL];
&amp;nbsp; &amp;nbsp; selection=[[bay,level,1]];
&amp;nbsp; &amp;nbsp; function_s(rack, "setNumLevels", level,selection);
&amp;nbsp; &amp;nbsp; function_s(rack, "setLevelSize",table&lt;N&gt;[LEVEL_HEIGHT], selection);
&amp;nbsp; &amp;nbsp; int numslots=table&lt;N&gt;[NUMSLOTS];
&amp;nbsp; &amp;nbsp; if (numslots==0)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function_s(rack, "setSlotStorable",0, selection);
&amp;nbsp; &amp;nbsp; else{
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function_s(rack, "setSlotStorable",1, selection);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function_s(rack, "setNumSlots",numslots, selection);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function_s(rack, "setSlotSize",baywidth/numslots, selection);
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; 
}&lt;/N&gt;&lt;/N&gt;&lt;/N&gt;&lt;/N&gt;&lt;/N&gt;&lt;/PRE&gt;&lt;P&gt;Model attached.&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/34753-test-setracksizefromtable-jl.fsm" target="_blank"&gt;test_setRackSizeFromTable_jl.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 30 Nov 2020 02:13:56 GMT</pubDate>
    <dc:creator>jason_lightfoot_adsk</dc:creator>
    <dc:date>2020-11-30T02:13:56Z</dc:date>
    <item>
      <title>How to change rack slot size according to global table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550515#M55276</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 20.2.3 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello.&lt;/P&gt;
 &lt;P&gt;I want to update rack dimensions from the table. I do not want to change the size of each slot manually, because data about the slot size are updateable, and from simulation to simulation can be changed (its main parameter of research). So I created a rack with a maximal quantity of slot and slots size. And after the simulation start, I want to change the sizes of each slot according to table data. Please see a model by the link below.&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/34729-test.fsm" target="_blank"&gt;Test.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 29 Nov 2020 12:07:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550515#M55276</guid>
      <dc:creator>aleksey_s</dc:creator>
      <dc:date>2020-11-29T12:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to change rack slot size according to global table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550516#M55277</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Here's a user command where you can pass in the rack and the reference of the table like this:&lt;/P&gt;&lt;PRE&gt;configureRackFromTable(Model.find("DK_1"),reftable("WH_MAP"));&lt;/PRE&gt;&lt;P&gt;The code for it is:&lt;/P&gt;&lt;PRE&gt;/**Custom Code*/
Object rack=param(1);
Table table =param(2);
Array loc=[1,1,1];
Array selection = [loc];
function_s(rack, "setNumBays", 1);
function_s(rack, "setNumSlots", 1); //, selection);
function_s(rack, "setNumLevels", 1); //, selection);

int numrows=table.numRows;
//SET COLUMN IDX FOR SPEED
#define BAY 2
#define BAY_WIDTH 3
#define LEVEL 4
#define LEVEL_HEIGHT 5
#define NUMSLOTS 6
function_s(rack, "setNumBays", (table[numrows][BAY]+1)/2);


for (int n=1;n&amp;lt;=numrows;n++) {
&amp;nbsp; &amp;nbsp; double &amp;nbsp;baywidth=table&lt;N&gt;[BAY_WIDTH];
&amp;nbsp; &amp;nbsp; int bay=(table&lt;N&gt;[BAY]+1)/2;
&amp;nbsp; &amp;nbsp; selection=[[bay,1,1]];
&amp;nbsp; &amp;nbsp; function_s(rack, "setBaySize", baywidth,selection);
&amp;nbsp; &amp;nbsp; int level=table&lt;N&gt;[LEVEL];
&amp;nbsp; &amp;nbsp; selection=[[bay,level,1]];
&amp;nbsp; &amp;nbsp; function_s(rack, "setNumLevels", level,selection);
&amp;nbsp; &amp;nbsp; function_s(rack, "setLevelSize",table&lt;N&gt;[LEVEL_HEIGHT], selection);
&amp;nbsp; &amp;nbsp; int numslots=table&lt;N&gt;[NUMSLOTS];
&amp;nbsp; &amp;nbsp; if (numslots==0)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function_s(rack, "setSlotStorable",0, selection);
&amp;nbsp; &amp;nbsp; else{
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function_s(rack, "setSlotStorable",1, selection);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function_s(rack, "setNumSlots",numslots, selection);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function_s(rack, "setSlotSize",baywidth/numslots, selection);
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; 
}&lt;/N&gt;&lt;/N&gt;&lt;/N&gt;&lt;/N&gt;&lt;/N&gt;&lt;/PRE&gt;&lt;P&gt;Model attached.&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/34753-test-setracksizefromtable-jl.fsm" target="_blank"&gt;test_setRackSizeFromTable_jl.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 Nov 2020 02:13:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550516#M55277</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2020-11-30T02:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to change rack slot size according to global table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550517#M55278</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;jason.lightfoot, you made magic. It was what I do not know and could not find here. I hope your answer and my question will be useful for other peoples.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 Nov 2020 07:34:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550517#M55278</guid>
      <dc:creator>aleksey_s</dc:creator>
      <dc:date>2020-11-30T07:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to change rack slot size according to global table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550518#M55279</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Jason's answer is correct and the best answer, for now. I'd like to add something to property tables that allows you to do this essentially through property tables or the Object.setProperty() API, deprecating this solution. I am just not so excited about users calling function_s() directly, because these are not technically forward-compatible solutions. If at some point in the future we change the way things work under the hood, these functions may not work going forward.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 04 Dec 2020 17:24:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-rack-slot-size-according-to-global-table/m-p/13550518#M55279</guid>
      <dc:creator>anthony_johnsonT83CM</dc:creator>
      <dc:date>2020-12-04T17:24:16Z</dc:date>
    </item>
  </channel>
</rss>

