I am working on something to explode blocks to a certain depth. Once I have done that, I go to move all hatches in model space to the back through the DrawOrderTable object associated with the BlockTableRecord. In a certain drawing it always cause the error "Error handler re-entered. Exiting now." where the message box is titled "AutoCAD Error-abort". This leads me to assume the error is within AutoCAD's core, as I cannot trap the error with a Try/Catch block. If I erase all the hatch entities, then the error goes away. If I use Commit on the transaction, there is no issue. But if I use Abort, which I have to to get all the items back to their original state, then the error happens every time.
I cannot post the code or drawing, but was wondering if I am thinking wrong? or if I should pass this one on to AutoDesk? or is there any way I can get the drawing back to it's original state before I started my command?
Thanks in advance.
Edit: I should point out that the program works fine in all other drawings tested, just this one has issues with the hatch patterns. Even if I Audit the file first.