<?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: Change Model Start Time in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/change-model-start-time/m-p/13528001#M37362</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi &lt;EM&gt;anonymous user&lt;/EM&gt;, was Matthew Gillespie's or Raja Sekaran's answer helpful? If so, please click the red "Accept" button on one of their answers. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 06 Oct 2020 20:46:04 GMT</pubDate>
    <dc:creator>Ben_WilsonADSK</dc:creator>
    <dc:date>2020-10-06T20:46:04Z</dc:date>
    <item>
      <title>Change Model Start Time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/change-model-start-time/m-p/13527999#M37360</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.0.9 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;About Model Units.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Is it possible to change the Model Start Time using FlexScript?&lt;/P&gt;
 &lt;P&gt;What FlexScript do I need to write?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:50:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/change-model-start-time/m-p/13527999#M37360</guid>
      <dc:creator>__ANON_USER__1</dc:creator>
      <dc:date>2020-09-29T07:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change Model Start Time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/change-model-start-time/m-p/13528000#M37361</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You should use the &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html#Method-DateTime" target="_blank"&gt;DateTime constructor&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For versions 21.1 and later use:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE style="padding: 9.5px; font-family: Menlo, Monaco, Consolas, ;"&gt;DateTime startTime = DateTime("9/11/2020 07:00:00", "%m/%d/%Y %I:%M:%S"); 
function_s(getmodelunit(START_TIME_NODE), "setDateTime", startTime);&lt;/PRE&gt;&lt;P&gt;If you want the warmup and stop times to keep the same relative model times you should update them too:&lt;/P&gt;&lt;PRE&gt;// Update the warmup and stop times so they keep the same model times
treenode warmupNode = getmodelunit(WARMUP_TIME_NODE);
function_s(warmupNode, "setModelTime", getsdtvalue(warmupNode, "modelTime"));

treenode stopNodes = getmodelunit(STOP_TIME_NODE);
for (int i = 1; i &amp;lt;= stopNodes.subnodes.length; i++) {
&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;treenode stopNode = stopNodes.subnodes&lt;I&gt;;
&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;function_s(stopNode, "setModelTime", getsdtvalue(stopNode, "modelTime"));
}&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;For versions 20.0 - 21.0 use:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;DateTime newStartTime = DateTime("9/11/2020 07:00:00", "%m/%d/%Y %I:%M:%S"); 
treenode startNode = getmodelunit(START_TIME_NODE); 
startNode.value = newStartTime.value; 
applicationcommand("convertunixtime", startNode, startNode.value);&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;For versions before 20.0:&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;See this answer: &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/questions/79484/which-are-the-commands-to-update-the-startwarm-ups.html" target="_blank"&gt;https://answers.flexsim.com/questions/79484/which-are-the-commands-to-update-the-startwarm-ups.html&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:30:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/change-model-start-time/m-p/13528000#M37361</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2020-09-29T15:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change Model Start Time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/change-model-start-time/m-p/13528001#M37362</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi &lt;EM&gt;anonymous user&lt;/EM&gt;, was Matthew Gillespie's or Raja Sekaran's answer helpful? If so, please click the red "Accept" button on one of their answers. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Oct 2020 20:46:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/change-model-start-time/m-p/13528001#M37362</guid>
      <dc:creator>Ben_WilsonADSK</dc:creator>
      <dc:date>2020-10-06T20:46:04Z</dc:date>
    </item>
  </channel>
</rss>

