Hi all, I've done a little odbx with vlisp, but this is my first attempt at it with vba (w2kp, a2k5). I could not find "ObjectDBX 1.0 Type Library" in my reference list, nor axdb16.tlb on my computer. (But "My Computer\HKEY_CLASSES_ROOT\ObjectDBX.AxDbDocument.16" is present in my registry.) So I referenced "AutoCAD/ObjectDBX Common 16.0 Type Library" (axdb16enu.tlb) despite previous posts that the former is what is needed. But then I get the subject line error at the set statement. Before I referenced the type library I got an 'undefined user type' error at the dim statement. Hopefully I'm missing something simple here, but I've searched the ngs quite a bit for an answer. Any suggestions appreciated. Code: Public Sub GetDbxDoc() Dim Doc As AxDbDocument Set Doc = AcadApplication.GetInterfaceObject("ObjectDBX.AcDbDocument.16") Doc.Open "M:\2005 Cad Support\MWE Base.dwg" End Sub
James, In 2004+ the reference is not ODBX 1.0 Type Library. I only have 2002, so I'm not sure what it should be, but another user I was helping recently found the right one rather quickly. Do you have any other ODBX types listed in the reference selection dialog? NOT the Autocad/ one, it must be listed by itself.
It looks OK to me. Maybe try Set Doc = AcadApplication.GetInterfaceObject("ObjectDBX.AcDbDocument.16.1")
Looks like there might be a problem with your instalation. See if the axdb16.dll is under the AutoCAD directory Register it manually using regsvr32 -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
Hey wait a minute, is that AcDbDocument.16 I see or is it just a spelling mistake on your post Check your code 'cause is should read AxDbDocument.16 -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
Oh my! You got it. I was afraid, but kind of hoping, I would end up feeling this silly. :\ <lol> Thank you Jorge, James
Still leaves me wondering about the missing piece though, since the consensus seems to be NOT to use Acad/Obj...Common... and I can't find the other (which is supposed to be registered already by acad?). axdb16.dll is present, so I tried start->run "regsvr32.exe c:\acad2005\axdb16.dll" and got this error message: ---------------------------------------------------------------------------- ------------- c:\acad2005\axdb16.dll was loaded, but the DllRegisterServer entry point was not found. DllRegisterServer may not be exported, or a corrupt version of c:\acad2005\axdb16.dll may be in memory. Consider using PView to detect and remove it.
AutoCAD/ObjectDBX Common 16.0 Type Library That's the one you should use in your references in VB What's finally loaded by your code is the axdb16.dll (that does not contain the type lib.) Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
Thanks again Jorge. I went back to google and it appears that I was (not only misspelling things, but also) trying to run on old information. Thank you, James