I am developing a plugin for AutoCAD Map 3D 2016.
I am getting an exception thrown by AutoCAD that seems to occur when programmatically switching layouts. Autocad crashes and I get the following message:
FATAL ERROR: Unhandled Access Violation Reading 0x0110 Exception at d622d98eh
The Autodesk problem report shows that my plugin is crashing when it hits a line of my code that switches to a different layout.
ObjectId layoutObjId = LayoutManager.Current.GetLayoutId(layoutName);
LayoutManager.Current.SetCurrentLayoutId(layoutObjId);
I have a test function that displays the state of the layout ObjectId. When AutoCAD crashes the DxfName is LAYOUT, IsValid is true and IsNull is false.
The crashing is intermittent. It seems to happen after several minutes of exercising the code while it programmatically deletes and/or creates layouts. It might take several minutes for this problem to occur.
I've gone through through the code searching for improperly disposing objects. I am using the GetObject method from the Transaction class to read to DBObjects, Entities, Polylines. My understanding is the all database objects instantiated by the GetObject command are managed and therefore do not need to manually disposed. I do add add AutoCAD objects back to the database and am wrapping those objects with the "using" statement.
How do I diagnose this problem?
I am developing a plugin for AutoCAD Map 3D 2016.
I am getting an exception thrown by AutoCAD that seems to occur when programmatically switching layouts. Autocad crashes and I get the following message:
FATAL ERROR: Unhandled Access Violation Reading 0x0110 Exception at d622d98eh
The Autodesk problem report shows that my plugin is crashing when it hits a line of my code that switches to a different layout.
ObjectId layoutObjId = LayoutManager.Current.GetLayoutId(layoutName);
LayoutManager.Current.SetCurrentLayoutId(layoutObjId);
I have a test function that displays the state of the layout ObjectId. When AutoCAD crashes the DxfName is LAYOUT, IsValid is true and IsNull is false.
The crashing is intermittent. It seems to happen after several minutes of exercising the code while it programmatically deletes and/or creates layouts. It might take several minutes for this problem to occur.
I've gone through through the code searching for improperly disposing objects. I am using the GetObject method from the Transaction class to read to DBObjects, Entities, Polylines. My understanding is the all database objects instantiated by the GetObject command are managed and therefore do not need to manually disposed. I do add add AutoCAD objects back to the database and am wrapping those objects with the "using" statement.
How do I diagnose this problem?
Hard to say without seeing your code. I've personally seen this error when improperly opening a 2nd transaction in Autocad Map 2015; furthermore the same improper code did NOT cause an exception in Autocad Map 2014. So that code was apparently more forgiving in previous versions of Map.
Can you debug with breakpoints to see exactly how far your code is getting and on what line the exception occurs?
Good luck!
Charlie
Hard to say without seeing your code. I've personally seen this error when improperly opening a 2nd transaction in Autocad Map 2015; furthermore the same improper code did NOT cause an exception in Autocad Map 2014. So that code was apparently more forgiving in previous versions of Map.
Can you debug with breakpoints to see exactly how far your code is getting and on what line the exception occurs?
Good luck!
Charlie
Can't find what you're looking for? Ask the community or share your knowledge.