I just finished and debugged a FEMAP Python script to perform the following tasks:
During the debugging process an error dialog pops up (see attached pic), but not sure what “Errors have occurred.”
Here’s a workflow that generates a “clean” run, then the error, back to a clean run.
After each model, I perform a fApp.feFileClose(False) and then fApp.feFileNew() to prepare for the next file. Other than opening a new FEMAP session to avoid this error, is there a “cleanup” I should perform ifI run my script on different directories during the same FEMAP session?
Solved! Go to Solution.
Do any red error messages occur further up in the message window?
It is possible that an error is called earlier in the process for an unrelated reason, then if the error flag has not been reset it will cause the general “Errors have Occurred” message at the end of the next translation. Typically this flag is reset after every command when using the GUI. The API however can run commands directly without ever resetting the flag.
Try resetting the flag programmatically using App.ErrorHasBeenCalled = False and if you track down what causes the error in the first place then let us know so we can investigate and see if any fixes are needed.
You may be also experiencing issues due to the Windows current directory not being set appropriately. This sometimes can occur when reading or writing files from Femap if the model file has never been saved. Try using app.feFileCurrentDirectory() method when saving files in different directories to assist with this.
The python script runs without any errors, so there are no red errors in the message area. I perform a fApp.feFileNew() before I load the model and results. Perform some PostProcessing setting to include rotating the model. I don't want to save any changes, so I use the fApp.fefileClose(False) after processing the current file. Repeat until I process all the files .nas files. Clean run.
I run the script again using the same FEMAP session, but pointing to a different dictory. That's when I get the "red error message" when it processes the first .nas file. In turn, I have to manually hit OK to dismiss the dialog. Then it will go through the same process of PostProcessing, Rotate, take pic and fApp.fefileClose(False). I'll get the red error message whenever I process the next .nas file.
Let me check out the App.ErrorHasBeenCalled = False and I'll report my findings.