Cancel
Showing results for 
Search instead for 
Did you mean: 

Femap API: Analysis error checking

Experimenter
Experimenter

Hello,

 

I've written an api program that involves running an analysis and processing the results. I've used the following code to 'pause' the program whilst the analysis is carried out:


    am.Analyze(amID) 'Analyze model
    OutputCount = OutputCount + 1
    Do While App.Info_Count(FT_OUT_CASE) = OutputCount
        'Idle
    Loop
    App.feAppMessage(FCM_COMMAND, "Results imported")

However, this code falls over if the analysis fails as the program is stuck in the loop. Can anyone reccomend a way to check for an error in the analysis and subsequently exit the program?

 

Any help appreciated!

 

Alex

3 REPLIES

Re: Femap API: Analysis error checking

Legend
Legend

Hello Alex,

 

you can check F06 or LOG file entries in your code.

 

Best regards

 

Peter

Re: Femap API: Analysis error checking

Experimenter
Experimenter

Hi Peter,

 

Thanks for your reply! What methods would i use to acheive that?

 

I've looked into using the feAppEventCallback method, however i would rather just pause the prgram while it waits for the event than have to call another program file to continue.

 

Regards,

 

Alex

Re: Femap API: Analysis error checking

Legend
Legend

Hello Alex,

 

you can see in my old post (http://community.plm.automation.siemens.com/t5/Femap-Discussion-Forum/Extended-Print-Dialog-API-Can-...) how can you use the FileSystemObject (you must add it first to References as in my macro).

For example you can check the size of the LOG file, and when it changed, you can read and analyze it. More help you can found here:

 

https://msdn.microsoft.com/en-us/library/aa711216(v=vs.71).aspx

 

Best regards

 

Peter