AutoCAD 2022 crashes with eNotOpenForWrite in a ARX/DBX/.Net custom app when opening an older dwg file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a ARX/DBX/.Net application that integrates with AutoCAD 2021 or AutoCAD 2022. This application allows the user to use and save custom objects in the dwg. Drawing files that include those custom objects could be saved and opened in AutoCAD 2021 without any issues. In AutoCAD 2022 some dwg files don’t open anymore but they open fine in AutoCAD 2021. The error message that is displayed in AutoCAD 2022 during dwg file open is
---------------------------
AutoCAD Error Aborting
---------------------------
INTERNAL ERROR: !dbobji.cpp@8673: eNotOpenForWrite
---------------------------
OK
---------------------------
You can also reproduce this issue by opening AutoCAD 2022 (with my application integrated), creating a new drawing and importing my database file. Saving the dwg file and reopening it works fine too. Then you type XREF and insert a dwg reference to the problematic dwg file (when prompted for insertion point type 0 and press enter). Save As again to a new dwg. Reopen the dwg and it will crash with the above error message. AutoCAD crashes hard and you get the AutoCAD crash reporting dialog.
Are you aware of any changes in AutoCAD 2022 that could have affected my application like that? Are there any debugging steps that I could take to pin point what goes wrong and where? I tried setting up breakpoints throughout my code in order to get the call stack and handle the exception in Visual Studio before it crashes AutoCAD but nothing gets hit. Running Windows 10 1909 but this happened on other machines with various Windows 10 versions. Any help would be greatly appreciated.