Once I have the dwg open how do I get to the database?
Dim AcadApp As Object = Nothing Dim AcadDoc As Object = Nothing Try AcadApp = GetObject(, "AutoCAD.Application.18") Catch ex As Exception AcadApp = CreateObject("AutoCAD.Application.18") End Try AcadApp.Visible = False Try AcadDoc = AcadApp.Documents.Open("C:\Users\PAUL\Desktop\B-03
-J-H135.dwg", True) Catch ex As Exception Exit Sub End Try Dim MyDb As Database = AcadApp.DocumentManager.MdiActiveDocument.Database
>> Once I have the dwg open how do I get to the database?
You have it, where is the question?
You have it here:
Dim MyDb As Database = AcadApp.DocumentManager.MdiActiveDocument.Database
That <MyDb> is the database of your currently active drawing!
- alfred -
From he code yoy showed (and also the code you showed in previous post), it looks like you are doing Stabdalone EXE apllication.
If so, you can forget about setting reference to acdbmgd.dll and acmgd.dll and using APIs exposed in these 2 assemblies: they CANNOT be used outside AutoCAD in a standalone app. End of story.
You have to use COM APIs. The code would be sililar to VBA code.
Well then tell me how. Because there are other apps out there doing what I need to do. According to the docs from ACAD, that is what those DLL's are for.
As you're mentioned above you HAVE NOT use dll libraries
in your .exe aplppliction at all,
so forget about them, indeed
Use just VBA like syntax and nothiing else, in the short words