question

andyru avatar image
0 Likes"
andyru asked Julie Weller commented

Exception in initialize environment when running model programmatically

I've been trying to run a model programmatically using the following answer: https://answers.flexsim.com/questions/21116/automatically-configure-and-run-a-flexsim-model.html. I'm able to get things to work with the test model provided in that answer.

However, when running with a real model, the model never starts. After calling go(), FlexSim seems to hang indefinitely. Nothing appears in the model view, and I get a spinner if I hover over the view. I see an exception `exception: FlexScript exception: MAIN:/project/events/OnStartApp/initialize environment` in the console.

I'm able to run the model successfully if I open it in FlexSim through the GUI, reset, and run, and the model runs can run programmatically on a coworker's machine. This makes me think something is wrong with my environment that is preventing the model from initializing.How can I debug what is causing the FlexScript exception in the initialization script?

FlexSim 23.0.9
flexscript exceptionprogrammatically invoking flexsim model
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Kavika F avatar image Kavika F ♦ commented ·
Hey @andyru, have you been able to successfully run the attached zip files in Ben's answer? Do you get the same errors? Could you please post the model so I could see if I can replicate your issue? If you can't post the model, you can either make this question private or you can post some screenshots so we can get a better idea of what kind of errors you're getting.
Thanks!
1 Like 1 ·
Julie Weller avatar image Julie Weller commented ·

Hi @andyru,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

0 Answers