Message 1 of 4
Unable to reference COM for AutoCAD 2006
Not applicable
09-07-2005
01:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
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