SEHException (0x80004005

SEHException (0x80004005

hakansupurkeci
Enthusiast Enthusiast
1,183 Views
2 Replies
Message 1 of 3

SEHException (0x80004005

hakansupurkeci
Enthusiast
Enthusiast

Hi,

 

Can anyone provide information about this error?

 

Thanks. 

 

45.PNG

0 Likes
Accepted solutions (1)
1,184 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

The SEHException can be caused by all kinds of things within any kind of .NET code. You can see various examples by looking globally for 'SEHException Revit':

 

https://duckduckgo.com/?q=SEHException+Revit

 

The second and third lines are more relevant, because they provide a hint on what is causing it:

 

An external component (your add-in?) executed a dynamic cast that failed.

 

I would suggest running your add-in in the debugger.

 

That will enable you to quickly pin down the offending cast operation.

  

 

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

hakansupurkeci
Enthusiast
Enthusiast
Accepted solution
Thank you for your quick response.

xyz1 = basisX.CrossProduct(ductLine.Direction);

It was giving error on this line.

I was sending an array of elements to the loop.

At the end of the loop, I was taking the "line" of the element and using it later in the loop if needed. I was doing this because at the end of each loop I deleted the item.

I collect the elements to be deleted in the array and delete them when the whole process is finished.
at the end of the cycle
"ductLine = ((LocationCurve)elements[x].Location).Curve as Line;"
Instead of importing in this way, I reached the place I needed directly from the array and the problem was solved.

xyz1 = basisX.CrossProduct(elements[lineLokasyon].Direction);
0 Likes