.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FatalExecutionEngineError was detected

7 REPLIES 7
Reply
Message 1 of 8
SRSDS
1091 Views, 7 Replies

FatalExecutionEngineError was detected

Hi all,

I have almost finished an application which has been working fine on small drawing files.

I don't know that it's the big drawing that is the problem but I've just tried to open a larger 7Mb file and am getting a FatalExecutionEngineError.

 

The error stems from a reactor that reviews the drawing on open (DocumentBecameCurrent). More specifically it is trying to open the NOD. 

 

Attached are screenshots of the reactor and the error. Can someone suggest what might be upsetting it.

7 REPLIES 7
Message 2 of 8
Alfred.NESWADBA
in reply to: SRSDS

Hi,

 

what I see, just a short look to the screenshots: you do a transaction.Commit, but you don't do a transaction.Dispose ... and not disposing a transaction is imho one of the things you should really avoid.

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 8
SRSDS
in reply to: Alfred.NESWADBA

Hi Alfred,

I've just done a find and replace to include a trans.dispose after all the trans.commit s.

I'm still left with the same error.

 

Another application appears to have used the NOD on this drawing. Could it be that it has left a broken trail somewhere?

Message 4 of 8
Alfred.NESWADBA
in reply to: SRSDS

Hi,

 

>> Another application appears to have used the NOD on this drawing.

>> Could it be that it has left a broken trail somewhere?

What I'm thinking about is that if you do some modifications in the drawing without starting a command (like you do it during the event-handler) you normally have to lock the document.

 

I don't see you lock it. But then you would get another error message, so I didn't mention this in my first thread ..... BUT NOW, as you wrote that you are running multiple applications parallel, both accessing the same objects, it would be time to check that. Try either to write a log-file so you can see what applications have what objects opened/modified/closed at the moment the debugger stops because of this exception.

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 5 of 8
SRSDS
in reply to: Alfred.NESWADBA

Hi again,

 

Not sure how to create a log file but there's only my application running at the moment. The other NOD entries must have been created on another computer at another time. 


I'm not sure how to create a log file..however...I think I've found the source of the problem.

 

Something is wrong with the 

Dim psr As PromptSelectionResult = ed.SelectAll(filter)

line in the following procedure. Trying to step past it causes the computer to think for a while before failing. It is a big file and maybe this is the problem?

 

 

    Public Sub GetTitleBlocks(ByVal trans As Transaction, ByVal db As Database, ByVal ed As Editor)
        Dim values As TypedValue() = New TypedValue() {New TypedValue(CType(DxfCode.ExtendedDataRegAppName, Short), "TitleBlock")}
        Dim filter As SelectionFilter = New SelectionFilter(values)
        Try
            Dim psr As PromptSelectionResult = ed.SelectAll(filter)
            If psr.Status = PromptStatus.OK Then
                Dim idarray As ObjectId() = psr.Value.GetObjectIds()
                TitleBlockDict.Clear()
                TitleBlockDict.Add("", "Unassigned")
                For Each ObjID In idarray
                    Dim Ent As Entity = trans.GetObject(ObjID, OpenMode.ForRead)
                    Dim myXdata As Array = Ent.XData.AsArray
                    TitleBlockDict.Add(myXdata.GetValue(1).value, GetAttributeValue(ObjID, "DRAWING_NO", trans))
                Next
            End If
        Catch ex As Autodesk.AutoCAD.Runtime.Exception
            MsgBox("Exception:" + ex.Message)
        End Try
    End Sub
Message 6 of 8
hgasty1001
in reply to: SRSDS

Hi:

 

Not sure (did not test your code) but, I think it's better tofilter for xdata regap this way:

 

Dim value(0) as TypedValue

 

value.SetValue(New TypedValue(DxfCode.ExtendedDataRegAppName,"RegapName"),0)

 

Gaston Nunez

Message 7 of 8
SRSDS
in reply to: hgasty1001

Hi again,

 

It took a long while but I've figured out that the error occurs when the selection (Dim psr As PromptSelectionResult = ed.SelectAll(filter)) is being attempted while in paperspace and not model space.

 

Would I need to use code to switch to modelspace first or is there coding I can use to make the filtered selection from modelspace directly?

 

 

Message 8 of 8
SRSDS
in reply to: SRSDS

I worked out that

 

I was not thorougly enough passing the e.Document.Editor, e.Document.Database & e.Document.TransactionManager.StartTransaction through to all the procedures in the event handlers.

 

This is strange to me but..

I was also adding handlers to the opened document before conducting some routines on the drawing.

Adding the handlers after the routines seemed to help.

 

Took a lot of trial and error to work out the order of routines and event handlers to get it error free.

DocumentActivationChanged is one event I couldn't figure out.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost