<?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 Evaluating FlexScript cells in Global Table after MTEI import in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503995#M18497</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.0.3 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;We have a model where we are using the following syntax to fetch Global Table values:&lt;/P&gt;&lt;PRE&gt;int value = Table("tableName")["row_name"]["col_name"];&lt;/PRE&gt;&lt;P&gt;Some of the cells in the table are numbers assigned as numeric data, while others are distributions that are assigned as FlexScript data. This works very well as it evaluates the distribution similar to executetablecell, and is much faster than our previous row and column lookup code.&lt;/P&gt;&lt;P&gt;The issue we are having is when we import table information via MTEI, it changes the cells that are assigned as FlexScript to string data, which prevents the code above from evaluating the distribution. Is there a way to preserve how the cells are assigned to keep them set as FlexScript, or is there some code I can run after the MTEI import that would set each of the string cells to be FlexScript data type instead? Alternatively, if the value is stuck as a string as a result of the MTEI import, is there a "dot syntax" way to perform a type conversion to execute the contents of a string cell (like how executetablecell works)?&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.flexsim.com/questions/ask.html#"&gt;@Matthew Gillespie&lt;/A&gt;, I've seen you reply to these kinds of questions before so I am tagging you in the hopes that you can help. Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Fri, 16 Mar 2018 21:40:05 GMT</pubDate>
    <dc:creator>jon_abbott</dc:creator>
    <dc:date>2018-03-16T21:40:05Z</dc:date>
    <item>
      <title>Evaluating FlexScript cells in Global Table after MTEI import</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503995#M18497</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.0.3 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;We have a model where we are using the following syntax to fetch Global Table values:&lt;/P&gt;&lt;PRE&gt;int value = Table("tableName")["row_name"]["col_name"];&lt;/PRE&gt;&lt;P&gt;Some of the cells in the table are numbers assigned as numeric data, while others are distributions that are assigned as FlexScript data. This works very well as it evaluates the distribution similar to executetablecell, and is much faster than our previous row and column lookup code.&lt;/P&gt;&lt;P&gt;The issue we are having is when we import table information via MTEI, it changes the cells that are assigned as FlexScript to string data, which prevents the code above from evaluating the distribution. Is there a way to preserve how the cells are assigned to keep them set as FlexScript, or is there some code I can run after the MTEI import that would set each of the string cells to be FlexScript data type instead? Alternatively, if the value is stuck as a string as a result of the MTEI import, is there a "dot syntax" way to perform a type conversion to execute the contents of a string cell (like how executetablecell works)?&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.flexsim.com/questions/ask.html#"&gt;@Matthew Gillespie&lt;/A&gt;, I've seen you reply to these kinds of questions before so I am tagging you in the hopes that you can help. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 21:40:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503995#M18497</guid>
      <dc:creator>jon_abbott</dc:creator>
      <dc:date>2018-03-16T21:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating FlexScript cells in Global Table after MTEI import</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503996#M18498</link>
      <description>&lt;P&gt;Here is the code to turn a node with string data into a FlexScript node:&lt;/P&gt;&lt;PRE&gt;treenode theNode;
switch_flexscript(theNode, 1);
buildnodeflexscript(theNode);
&lt;/PRE&gt;&lt;P&gt;If you wanted to toggle all string nodes in a table you could use code like this:&lt;/P&gt;&lt;PRE&gt;Table table = Table("GlobalTable1");

for(int i = 1; i &amp;lt;= table.numRows; i++) {
	for(int j = 1; j &amp;lt;= table.numCols; j++) {
		treenode theNode = table.cell(i, j);
		if(theNode.dataType == DATATYPE_STRING) {
			switch_flexscript(theNode, 1);
			buildnodeflexscript(theNode);
		}
	}
}
&lt;/PRE&gt;&lt;P&gt;The equivalent of the executetablecell() command in the Table API is the executeCell method:&lt;/P&gt;&lt;PRE&gt;int value = Table("GlobalTable1").executeCell(2,2);&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Mar 2018 22:24:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503996#M18498</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-03-16T22:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating FlexScript cells in Global Table after MTEI import</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503997#M18499</link>
      <description>&lt;P&gt;You can also execute that code as part of the MTEI so that it happens immediately after the import. Put the code in the Post Import Code in the MTEI window:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="10871-post-import-code.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1496769iC0BF05E2DA82F134/image-size/large?v=v2&amp;amp;px=999" role="button" title="10871-post-import-code.png" alt="10871-post-import-code.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 15:08:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503997#M18499</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2018-03-19T15:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating FlexScript cells in Global Table after MTEI import</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503998#M18500</link>
      <description>&lt;P&gt;Thanks Matthew and Phil! I will give these recommendations a try as soon as I can.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 15:15:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503998#M18500</guid>
      <dc:creator>jon_abbott</dc:creator>
      <dc:date>2018-03-22T15:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating FlexScript cells in Global Table after MTEI import</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503999#M18501</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt; and &lt;A rel="user" href="https://answers.flexsim.com/users/206/phil.b.html" nodeid="206"&gt;@phil.bobo&lt;/A&gt;, thanks for sending these examples. We implemented them into a model and it works great. We did have to set the starting column number to something other than 1 (as we have some string data in some columns that we want to leave as string data), but otherwise the code works exactly as expected. Thanks again. &lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 18:47:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/evaluating-flexscript-cells-in-global-table-after-mtei-import/m-p/13503999#M18501</guid>
      <dc:creator>jon_abbott</dc:creator>
      <dc:date>2018-03-26T18:47:54Z</dc:date>
    </item>
  </channel>
</rss>

