I'm able to set the COM references now to AutoCAD as:
AutoCAD 2006 Type Library 1.1
AutoCAD/ObjectDBX Common 16.0 Type Library
... these statements work now. (before, the .Common did not show up as a
choice, but does now).
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
For some reason there were double entries (and versions) in
C:\WINDOWS\assembly for:
Autodesk.AutoCAD.Interop
Autodesk.AutoCAD.Interop.Common
Uninstalling AutoCAD took care of one set of entries. But had to regedit
(delete) the other two
from \installer\assemblies\global so that they could be deleted from the
C:\windows\assembly folder.
Maybe these were left over when upgrading from AutoCAD 2005????
Anyway, after reinstalling AutoCAD it appears to be working. And, now... I'm
looking forward
to RELEARNING the object model & REWRITING all of my VB 6 AutoCAD apps. ;-(
Marty
"Marty" wrote in message
news:4949641@discussion.autodesk.com...
In VB.net (2003) I can set a reference to AutoCAD 2000 type library from the
COM tab.
Then, using:
Imports AutoCAD
'the following variables can be declared...
Public AcadDoc As AcadDocument, AcadApp As AcadApplication
'and this will connect to the current AutoCAD session & Drawing.
AcadApp = GetObject(, AutoCAD.Application.15)
AcadDoc = AcadApp.ActiveDocument
But, I can't seem to do the same thing for AutoCAD 2006. Reference is set
for AutoCAD 2006
type library from the COM tab. Also using:
Imports AutoCAD 'error: namespace or type cannot be found
'the following variables can't be declared...
Public AcadDoc As AcadDocument, AcadApp As AcadApplication
'error: both show 'type not defined'
'and this can't work because the object variables are'nt set.
AcadApp = GetObject(, AutoCAD.Application.16.2)
AcadDoc = AcadApp.ActiveDocument
Any help or nudge in the right direction would be much appreciated.
Marty