
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone,
Two days I'm diving into ObjectARX/ObjectDBX areas to create little prove of concept for my project.
My goal is to iterate 9000 dwg files and to extract some data from them.
My environment:
1. Windows 10 Pro 64bit
2. AutoCAD 2019 - commercial license
3. Installed ObjectARX 2020 Wizards (Autodesk_ObjectARX_2019_Win_64_and_32_Bit)
4. Visual Studio 2017 Community edition
5. AutoCAD 2020 .NET Wizards (not necessary but installed)
I created Visual Basic Console App (.NET Framework) project (just try ot open DWG file) with dll refs only for ObjectDBX from ObjectARX(acdb23.lib,acge23.lib,acgiapi.lib,axdb.lib,rxapi.lib,acismobj23.lib) with just one executable source as following :
Imports Autodesk.AutoCAD.DatabaseServices Module Module1 Sub Main() Try Dim db As Database db = New Database(False, True) db.ReadDwgFile("C:\WORK\Tests\20200129\dobrich.dwg", System.IO.FileShare.ReadWrite, False, "") db.CloseInput(True) HostApplicationServices.WorkingDatabase = db Using tr As Transaction = db.TransactionManager.StartTransaction() End Using Debug.Write("End") Catch ex As Exception Debug.WriteLine(ex.Message) End Try Debug.WriteLine("End") End Sub End Module
But I have always such error:
Exception thrown: 'System.InvalidProgramException' in ConsoleApp5.exe
Common Language Runtime detected an invalid program.
I know that such error is common if I use ObjectARX dll ourside of ObjectDBX because I will need AutoCAD app, but this is not the case in my code.
I cannot understand why I have such error in case of exploanation in Autodesk documentations that must be working fine.
Any suggestion for fix of that error ?
Regards
Solved! Go to Solution.