.NET
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
*Marty
Unable to reference COM for AutoCAD 2006
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
151 Views, 3 Replies
09-07-2005 01:57 PM
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
Re: Unable to reference COM for AutoCAD 2006
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-07-2005 04:04 PM in reply to:
*Marty
Add another reference to the AutoCAD/ObjectDBX Common 16.0 Type Library.
Regards - Nathan
Regards - Nathan
*Marty
Re: Unable to reference COM for AutoCAD 2006
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-08-2005 06:21 AM in reply to:
*Marty
Thanks Nathan... I added the reference, but the "Imports AutoCAD" statement
still isn't recognized as a valid namespace.
Is there a different or multiple "Imports" statement that's needed now for
AutoCAD 2006 to interact with COM from vb.net?
Marty
wrote in message news:4949758@discussion.autodesk.com...
Add another reference to the AutoCAD/ObjectDBX Common 16.0 Type Library.
Regards - Nathan
still isn't recognized as a valid namespace.
Is there a different or multiple "Imports" statement that's needed now for
AutoCAD 2006 to interact with COM from vb.net?
Marty
Add another reference to the AutoCAD/ObjectDBX Common 16.0 Type Library.
Regards - Nathan
*Marty
Re: Unable to reference COM for AutoCAD 2006
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-08-2005 12:40 PM in reply to:
*Marty
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
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"
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
