Showing results for 
Search instead for 
Did you mean: 

API crash with feFileExit




I've come across a "bug" I can't explain and about which I would appreciate further info (cf code below). I'm trying to run an API at the end of which FEMAP will be closed with no user interaction.


If I do only step 1 and 4 it works fine

If I do step 1, 2 and 4 then FEMAP crashes

If I add step 3 it works


So it seams there is some kind of a handle left open when dealing with the view object.

My questions are:

- why? or rather is this normal?

- are there other FEMAP API objects for which this is true (which I need to "kill" to avoid crashing)? I need to apply this principle to a bunch of macros, which deal with many different FEMAP objects. I've tested with feNode for example and there is no crash.


Thanks for your help,





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

    Dim l1 As Long

    Dim v As femap.View
    Set v = App.feView

    Set v = Nothing

End Sub




Re: API crash with feFileExit

Siemens Phenom Siemens Phenom
Siemens Phenom

Yes this is a "bug"... it only happens though if you are calling feFileExit from the API with the View object "loaded". The problem is that internally the View object references a Set object and since you did not "destroy" the View, the internal Set was not cleaned up until too late in the exiting process.  This will be corrected in v11.2.1.  Of course setting the view to "Nothing" will also solve the problem.


There are other object types like this where Set objects are referenced, but since the fix for v11.2.1 actually applied to the Set object and not the View, it should apply to all of those types.

Re: API crash with feFileExit


Perfect thank you, we will switch to v11.2.1 when it comes out