Cancel
Showing results for 
Search instead for 
Did you mean: 

Suppress Message Window errors for feFileReadNastran API method

Creator
Creator

Hello everyone,

I am looking to automate an analysis process using the Femap API compiled for Python.  To begin, I need to import an NX Nastran file to which I can then apply loads using my script.  I am able to successfully load the model using the following code:

 

import pythoncom
import Pyfemap
# ... Method header
existObj = pythoncom.connect(Pyfemap.model.CLSID) #Grabs active model
femap = Pyfemap.model(existObj)
# ... Additional initialization code here    
rc=femap.feFileReadNastran(8,"cube.dat")

During the file read operation, however, I receive the following error messages in Femap's Message Window:

 

Element 360641 or Region Top Face Below Bottom Face. Switching.
Element 360642 or Region Top Face Below Bottom Face. Switching.
Element 360643 or Region Top Face Below Bottom Face. Switching.
Element 360644 or Region Top Face Below Bottom Face. Switching.
Element 360645 or Region Top Face Below Bottom Face. Switching.
Element 360646 or Region Top Face Below Bottom Face. Switching.
Element 360647 or Region Top Face Below Bottom Face. Switching.
Element 360648 or Region Top Face Below Bottom Face. Switching.
...
Skipping Additional Errors...
...
Errors have Occurred. Check Message Window.

 

I next also receive a Dialog Box pop-up, which I am able to dismiss programmatically by setting the "DialogAutoSkipMsg" global variable equal to 1 at the top of my script.

 

Interestingly, I do not receive the same error when I import the model manually in the GUI via "File -> Import -> Analysis Model."  Instead, it outputs this message in blue:

 

131072 Inverted Solid Elements. Elements were switched so Top Face is Above the Bottom Face.

 

Is there any way to make the programmatic import behave the same way as the manual import via the GUI?  While I understand that I can simply disable error pop-ups by setting the above global flag, I would prefer not to do this in case the program encounters a serious error that needs to be addressed while my script is performing the automated analysis.  Furthermore, printing a large number of error messages to the Message Window slows down the process signficantly and clutters up the Message Window, which I would like to try to avoid.

 

Thanks!