<?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: Convert rack bays treenode to tables in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562913#M65058</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;If someone knows how to evaluate a coupling node in a query better than over a string path, you are welcome to share&lt;/P&gt;&lt;PRE&gt;getvarnode(ownerobject .. "bays") // here a shorter code line&lt;/PRE&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 05 Jun 2020 13:54:30 GMT</pubDate>
    <dc:creator>joerg_vogel_HsH</dc:creator>
    <dc:date>2020-06-05T13:54:30Z</dc:date>
    <item>
      <title>Convert rack bays treenode to tables</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562910#M65055</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;The dimensions were for the rack object in previous versions of FlexSim 19 built as tables. In FlexSim 19 the structure has been integrated into the node "bays". I would like to extract by table queries the old tables for content, size and location from this new structure.  &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="21074-treenode-bays-rack.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1499787iE6FD921F35E21572/image-size/large?v=v2&amp;amp;px=999" role="button" title="21074-treenode-bays-rack.jpg" alt="21074-treenode-bays-rack.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A id="21075" href="https://answers.flexsim.com/storage/attachments/21075-treenode-bays-rack.fsm"&gt;treenode-bays-rack.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 10:38:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562910#M65055</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2019-07-30T10:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert rack bays treenode to tables</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562911#M65056</link>
      <description>&lt;P&gt;I can rebuild the tables with the command forobjecttreeunder like:&lt;/P&gt;&lt;PRE&gt;treenode bays = Model.find("Rack1&amp;gt;variables/bays");&lt;BR /&gt;Table result = Table("dump1").setSize(1,1,DATATYPE_OBJECT,0);&lt;BR /&gt;int row = 1;&lt;BR /&gt;treenode rackCell;&lt;BR /&gt;forobjecttreeunder(bays)&lt;BR /&gt;{&lt;!-- --&gt;&lt;BR /&gt;   if (a.find("/loc")){&lt;!-- --&gt;&lt;BR /&gt;     rackCell = a.find("/loc").up;&lt;BR /&gt;     if( rackCell.up.name == "bays") continue; // erase next bay node&lt;BR /&gt;     result.cell(row,1).value = a.find("/loc").up); // collect only cells    &lt;BR /&gt;     result.addRow();&lt;BR /&gt;     row++;&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;result.deleteRow(row);&lt;/PRE&gt;&lt;P&gt;The table "dump1" contains all cell nodes. From here I can build the content table, size table, and location table.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 14:36:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562911#M65056</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2019-07-30T14:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert rack bays treenode to tables</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562912#M65057</link>
      <description>&lt;P&gt;I can get the cell reference by flattening the structure&lt;/P&gt;&lt;PRE&gt;treenode Bays = getvarnode(Model.find("Rack1"), "bays");
Table newt = Table.query("SELECT $3 AS Cell FROM $1x$2 ORDER BY Cell ASC",
       /*$1*/ Bays,
       /*$2*/ $iter(1).find("cells"),
       /*$3*/ $iter(2).subnodes["loc"].up 
       );
newt.cloneTo(Table("dump"));&lt;/PRE&gt;&lt;P&gt;IMPORTANT: I must set a ORDER BY clause after the flattening otherwise the query returns as result &amp;lt;No Data&amp;gt; for all cells.&lt;/P&gt;&lt;P&gt;Flexsim 19.2:&lt;/P&gt;&lt;PRE&gt;treenode Bays = getvarnode(Model.find("Rack1"), "bays");
Table newt = Table.query("SELECT $4 AS Slot FROM $1x$2x$3 ORDER BY Slot ASC",
	/*$1*/ Bays,  
	/*$2*/ $iter(1).find("levels"),
	/*$3*/ $iter(2).find("slots"),
	/*$4*/ $iter(3).subnodes["loc"].up );
newt.cloneTo(Table("dump"));&lt;/PRE&gt;&lt;P&gt;The global table "dump" contains references of every slot in a rack. You can get access by evaluating the Variant of a table cell of "dump" for deeper nodes by the method &lt;STRONG&gt;find(&lt;/STRONG&gt;string path&lt;STRONG&gt;)&lt;/STRONG&gt; and with the property &lt;STRONG&gt;up&lt;/STRONG&gt; for higher nodes.&lt;/P&gt;&lt;P&gt;Storage System all racks since 19.2:&lt;/P&gt;&lt;PRE&gt;treenode qnode = Model.find("Tools/StorageSystem&amp;gt;variables/storageObjects");
Table t1 = Table.query("SELECT $5 AS Node, $6 AS Slot, $7 AS Level, $8 AS Bay, $9 AS Rack FROM $1x$2x$3x$4"
                 ,qnode&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;   
                 ,getvarnode(ownerobject(Model.find($iter(1).value.getPath(model()))),"bays")&amp;nbsp;
                 ,$iter(2).find("levels")
                 ,$iter(3).find("slots")&amp;nbsp;
/*$5 slot node*/&amp;nbsp;,$iter(4).subnodes["loc"].up&amp;nbsp;
/*$6 slot &amp;nbsp;num*/ ,$iter(4).subnodes["loc"].up.rank&amp;nbsp;
/*$7 level num*/&amp;nbsp;,$iter(3).rank&amp;nbsp;
/*$8 bay &amp;nbsp; num*/ ,$iter(2).rank&amp;nbsp;
/*$9 rack node*/ ,ownerobject($iter(2))&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
                 ); 
t1.cloneTo(Table("dump")); &amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jul 2019 13:42:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562912#M65057</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2019-07-31T13:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert rack bays treenode to tables</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562913#M65058</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;If someone knows how to evaluate a coupling node in a query better than over a string path, you are welcome to share&lt;/P&gt;&lt;PRE&gt;getvarnode(ownerobject .. "bays") // here a shorter code line&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Jun 2020 13:54:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562913#M65058</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-06-05T13:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert rack bays treenode to tables</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562914#M65059</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;an Example for FlexSim 19.0 &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/temp/39361-warehouse19.fsm" target="_blank"&gt;Warehouse19.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 May 2021 20:11:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/convert-rack-bays-treenode-to-tables/m-p/13562914#M65059</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2021-05-10T20:11:29Z</dc:date>
    </item>
  </channel>
</rss>

