About Model Units.
Is it possible to change the Model Start Time using FlexScript?
What FlexScript do I need to write?
About Model Units.
Is it possible to change the Model Start Time using FlexScript?
What FlexScript do I need to write?
Hi anonymous user, 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.
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.
You should use the DateTime constructor.
For versions 21.1 and later use:
DateTime startTime = DateTime("9/11/2020 07:00:00", "%m/%d/%Y %I:%M:%S"); function_s(getmodelunit(START_TIME_NODE), "setDateTime", startTime);
If you want the warmup and stop times to keep the same relative model times you should update them too:
// 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 <= stopNodes.subnodes.length; i++) { treenode stopNode = stopNodes.subnodes[i]; function_s(stopNode, "setModelTime", getsdtvalue(stopNode, "modelTime")); }
For versions 20.0 - 21.0 use:
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);
For versions before 20.0:
See this answer: https://answers.flexsim.com/questions/79484/which-are-the-commands-to-update-the-startwarm-ups.html
14 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved