aio419
asked on
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
I am trying to get some block info from an Autocad drawing using vb.net.
It was working fine with autocad 2005.When we upgraded to autocad 2006, it is crashing.
The first one is having problem is in the line
Dim CurrentSpace As String
CurrentSpace = AppObj.ActiveDocument.Acti veLayout.B lock.Name '
This is returning >> "*Paper_Space"
For I = 0 To AppObj.ActiveDocument.Bloc ks.Count – 1 ‘ERROR IS HERE ’
Where Friend WithEvents AppObj As Autodesk.AutoCAD.Interop.A cadApplica tion
The error is
An unhandled exception of type 'System.Runtime.InteropSer vices.COME xception' occurred in DrawingIndexer.exe
Additional information: No database
If I look in the quick watch window for AppObj.ActiveDocument.Bloc ks this is the error
Blocks <error: an exception of type: {System.Runtime.InteropSer vices.COME xception} occurred>
Type: Autodesk.AutoCAD.Interop.C ommon.Acad Blocks
It was working fine with autocad 2005.When we upgraded to autocad 2006, it is crashing.
The first one is having problem is in the line
Dim CurrentSpace As String
CurrentSpace = AppObj.ActiveDocument.Acti
This is returning >> "*Paper_Space"
For I = 0 To AppObj.ActiveDocument.Bloc
Where Friend WithEvents AppObj As Autodesk.AutoCAD.Interop.A
The error is
An unhandled exception of type 'System.Runtime.InteropSer
Additional information: No database
If I look in the quick watch window for AppObj.ActiveDocument.Bloc
Blocks <error: an exception of type: {System.Runtime.InteropSer
Type: Autodesk.AutoCAD.Interop.C
ASKER
Yes,I readded the references. (named Autocad 2006 Type Library and AxdbLib.(16.0) type library)
from the COM tab
from the COM tab
Ok, so the developers have changed the interface for the type library, and you need to figure out how. I don't know what that would be exactly.
Bob
Bob
ASKER
Thanks for the reply.
I trying to find out why it is not working for acad 2006 with
AppObj.ActiveDocument.Bloc ks.Count giving no database error.
Do i need to add any other references or is there any change for Acad 2006 for this.
I trying to find out why it is not working for acad 2006 with
AppObj.ActiveDocument.Bloc
Do i need to add any other references or is there any change for Acad 2006 for this.
The type libraries for 2006 have been renamed, so did you add a reference to the new name? Do you still have 2005 installed?
Bob
Bob
The Autocad 2006 CD has documentation and samples that might help explain your problems.
Bob
Bob
ASKER
i do not have 2005 installed. I removed the reference for 2005 and added 2006 references.
I am out of ideas.
Bob
Bob
ASKER
After a struggle I figured out that it is a bug in Autocad and got a hot fix them to patch it.
It is working now.
Thanks for your replay though.
It is working now.
Thanks for your replay though.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bob