Cancel
Showing results for 
Search instead for 
Did you mean: 

Close FEMAP GUI using Window Command (No Need to save the file)

Creator
Creator

Dear FEMAP users,

I've run FEMA model with bas.file via window command line: 

ex) c:\FEMAPv11>femap.exe -prg FEMAP_Post_Processing.bas

 

After process complted, I would like to close FEMAP GUI using window command line (I do not need to save the model),

Is there anyway to close it via window command line??

 

Many thanks,

John Kang

 

 

4 REPLIES

Re: Close FEMAP GUI using Window Command (No Need to save the file)

Siemens Genius Siemens Genius
Siemens Genius

From the command line the only way I could think of doing it is to kill the process and wrap that up into a batch file, but that's certainly not ideal. Since you're already running an API, simply add an feFileExit call to the end of the API.

 

  • feFileExit will always ask to save the open model, so calling feFileClose(FALSE) before the exit is a good idea
  • You'll have to deal with any other dialogs that come up as well, such as the daily tip (I'd just turn that one off).
  • Something like this should work

 

The HTML Clipboard

Sub Main
    Dim App As femap.model
    Set App = feFemap()

    Dim fn As femap.Node
    Set fn = App.feNode

    fn.Put( 1 )
    App.feFileClose( False )
    App.feFileExit()


End Sub

Re: Close FEMAP GUI using Window Command (No Need to save the file)

Creator
Creator

Dear Pkrien,

Thanks for your reponse and it works well, but I have a minor issue in terms of Error message after I generated ABAQUS input file from FEMAP. Is there any way to remove this message using API??

 

Many thanks,

Re: Close FEMAP GUI using Window Command (No Need to save the file)

Siemens Genius Siemens Genius
Siemens Genius

There's two ways:

 

  • Hide the UI before the code that raises the error, and then display it again after:

        App.feAppVisible( False )
        App.feFileWriteAbaqus( 0, "c:\scratch\test.inp")
        App.feAppVisible( True )
    
  • Alternatively, you can set the application preference DialogAutoSkipMsg. This preference controls how dialogs work during APIs. 0 = dialogs shown as normal. > 0 = nth button is pressed (depends on the dialog automatically), while < 0 = nth button is pressed and dialog message is suppressed from the message window. Because this is an application level setting, I recommed saving the initial value first, setting your desired value, then setting it back. Otherwise, you run the risk of breaking funcionality of other API programs

        nPrev = App.DialogAutoSkipMsg
        App.DialogAutoSkipMsg = 1
    
        App.feFileWriteAbaqus( 0, "c:\scratch\test.inp")
    
        App.DialogAutoSkipMsg = nPrev

 

Re: Close FEMAP GUI using Window Command (No Need to save the file)

Creator
Creator

Dear Pkrien,

 

Thanks for your command and it works exactly what I want.

So now, I can map on an imported model from source model and then, generated ABAQUS input file with Node temperature!!!!

 

Best Regards,

John Kang