question

Sung K2 avatar image
1 Like"
Sung K2 asked Jason Lightfoot answered

FlexScript exception: MAIN:/project/exec/globals/nodefunctions/switchmodelhash

exception: FlexScript exception: MAIN:/project/exec/globals/nodefunctions/switchmodelhash

FlexSim throws an error message above, when I try to save the model after I edit/open/close some of Flexscript like usercommand.

If I ignore, close with SAVE, and reopen, the message is gone even though I save the model multiple times after edit the Flexscript for a while. But at some point it happens again. I couldn't find the exact cause yet. The only way for me to get rid of the error message is re-opening my model.

Anyone knows what I did wrong? Any clue about the error message? Any advice will be appreciated.


FlexSim 24.1.0
exception errorflexscript exceptionswitchmodelhash
5 |100000

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

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

If you can save a model such that when you open it and run applicationcommand("hash", model()) it gives an error - please upload for the team to check which part of the model is giving the error.

· 3
5 |100000

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

Sung K2 avatar image Sung K2 commented ·
Thank you for the explanation. However, I didn't run applicationcommad("hash", model()). I don't even know what it is. Is there a model event triggering the appllicationcommand("has", model()) automatically?? I am sorry that I can't share the model due to the confidentiality agreement with client.
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Sung K2 commented ·

You'd run that from a script console. Yes it's triggered by default when you load and save a model.

If you can't share it then you'll have to try deleting successive objects and running that command until it runs without exception. Without knowing what those objects are we won't be able to diagnose or help further.

0 Likes 0 ·
Sung K2 avatar image Sung K2 Jason Lightfoot ♦♦ commented ·
Thanks! I will try to follow your suggestion, deleting successive objects to find out what causes the exception.


One question, though. If the model has an object that causes the exception, why it does not throw the exception when I reopen and save the model again? I can successfully edit my scripts and save the model multiple times after reopening the model. It works fine for a while, but eventually throws the exception at some point later. It seems so random to me...


Thanks again for your advice. If I found any, I will share it here again.

Thanks!

0 Likes 0 ·