Message 1 of 3
Opening A2k from VB - Run-time error '-2145386390 (8020006a)'

Not applicable
03-02-2001
03:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have written a program that extracts attribute data from AutoCAD
drawings to populate a database. AutoCAD is not always on when the user
starts my program. I first try to connect to AutoCAD with the following
line:
Set ACAD = GetObject(, "Autocad.Application")
If that returns an error I try:
Set ACAD = CreateObject("AutoCad.Application")
These two statements and the next few statements that set up my object
references for AutoCAD come straight out of the AutoCAD help files:
Set DOC = ACAD.ActiveDocument
Set MS = DOC.ModelSpace
Set BLOCKS = DOC.BLOCKS
Set SSET = DOC.SelectionSets
Set UTIL = DOC.Utility
The problem is that sometimes after I have launched and connected to
AutoCAD and the DOC variable has been set, almost all of the other objects
in the AutoCAD environment have "No Database". I get an error message
saying: "Run-time error '-2145386390 (8020006a)'".
How can I update the AutoCAD environment or my VB environment to reflect
the fact that I have AutoCAD running.
I can't set the MS (ModelSpace) variable. That's the first one that
causes trouble, but I'm sure the others would return the same message
because when I look at the DOC object in the watch window, "No Database" is
the value of almost all of the objects.
Any help is appreciated. Thank you.
Sincerely,
Michael Madrid
drawings to populate a database. AutoCAD is not always on when the user
starts my program. I first try to connect to AutoCAD with the following
line:
Set ACAD = GetObject(, "Autocad.Application")
If that returns an error I try:
Set ACAD = CreateObject("AutoCad.Application")
These two statements and the next few statements that set up my object
references for AutoCAD come straight out of the AutoCAD help files:
Set DOC = ACAD.ActiveDocument
Set MS = DOC.ModelSpace
Set BLOCKS = DOC.BLOCKS
Set SSET = DOC.SelectionSets
Set UTIL = DOC.Utility
The problem is that sometimes after I have launched and connected to
AutoCAD and the DOC variable has been set, almost all of the other objects
in the AutoCAD environment have "No Database". I get an error message
saying: "Run-time error '-2145386390 (8020006a)'".
How can I update the AutoCAD environment or my VB environment to reflect
the fact that I have AutoCAD running.
I can't set the MS (ModelSpace) variable. That's the first one that
causes trouble, but I'm sure the others would return the same message
because when I look at the DOC object in the watch window, "No Database" is
the value of almost all of the objects.
Any help is appreciated. Thank you.
Sincerely,
Michael Madrid