.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
extablishi ng a COM Interface from a .Net dll using 2006
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
59 Views, 2 Replies
06-15-2005 08:47 AM
I would like to extablish a COM interface to AutoCAD 2006 using a .Net dll.
I am able to obtain an system.__ComObject using the following code (this is a class that is created from within my .net dll)
I recieve an exception when I try to reference the active document via this interface
Imports Autodesk.AutoCAD.Interop
Imports AcadCOMintf = Autodesk.AutoCAD.ApplicationServices.Application
Public Enum eDevType
FullScalePDF = 1
FullScaleXerox = 2
End Enum
Public Class ComPlotSetup
Public Shared oAcadCOMApp As Autodesk.AutoCAD.Interop.AcadApplication = CType(AcadCOMintf.AcadApplication, AcadApplication)
Public Sub New(ByVal oPresentFormatInfo As PresentFormat, ByVal DeviceType As eDevType)
Try
Dim oacadCOMDoc As Autodesk.AutoCAD.Interop.AcadDocument
oacadCOMDoc = oAcadCOMApp.DocumentManager.MdiActiveDocument
oacadCOMDoc = oAcadCOMApp.Preferences
Catch
End Try
End Sub
End Class
I am able to obtain an system.__ComObject using the following code (this is a class that is created from within my .net dll)
I recieve an exception when I try to reference the active document via this interface
Imports Autodesk.AutoCAD.Interop
Imports AcadCOMintf = Autodesk.AutoCAD.ApplicationServices.Application
Public Enum eDevType
FullScalePDF = 1
FullScaleXerox = 2
End Enum
Public Class ComPlotSetup
Public Shared oAcadCOMApp As Autodesk.AutoCAD.Interop.AcadApplication = CType(AcadCOMintf.AcadApplication, AcadApplication)
Public Sub New(ByVal oPresentFormatInfo As PresentFormat, ByVal DeviceType As eDevType)
Try
Dim oacadCOMDoc As Autodesk.AutoCAD.Interop.AcadDocument
oacadCOMDoc = oAcadCOMApp.DocumentManager.MdiActiveDocument
oacadCOMDoc = oAcadCOMApp.Preferences
Catch
End Try
End Sub
End Class
Re: extablishi ng a COM Interface from a .Net dll using 2006
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-15-2005 09:54 AM in reply to:
Chris Ludtke
Scratch this line, It is an anomoly of "Cut and Paste"
oacadCOMDoc = oAcadCOMApp.Preferences
Also, is there any way to get the COM based application object from an
Autodesk.AutoCAD.ApplicationServices.Document object
Please tell me if I am grossly misinformed and out to lunch. I am about ready to take my ball and go home.
oacadCOMDoc = oAcadCOMApp.Preferences
Also, is there any way to get the COM based application object from an
Autodesk.AutoCAD.ApplicationServices.Document object
Please tell me if I am grossly misinformed and out to lunch. I am about ready to take my ball and go home.
Re: extablishi ng a COM Interface from a .Net dll using 2006
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-15-2005 10:02 AM in reply to:
Chris Ludtke
I guess that I am still playing ball. this works.
Imports Autodesk.AutoCAD.Interop
Imports AcadCOMintf = Autodesk.AutoCAD.ApplicationServices.Application
Public Enum eDevType
FullScalePDF = 1
FullScaleXerox = 2
End Enum
Public Class ComPlotSetup
Public Shared oAcadCOMApp As Autodesk.AutoCAD.Interop.AcadApplication = CType(AcadCOMintf.AcadApplication, AcadApplication)
Public Sub New(ByVal oPresentFormatInfo As PresentFormat, ByVal DeviceType As eDevType)
Try
Dim oAcadCOMDoc As Autodesk.AutoCAD.Interop.AcadDocument
oAcadCOMDoc = oAcadCOMApp.ActiveDocument
MsgBox(oAcadCOMDoc.Name)
Catch
End Try
End Sub
End Class
Imports Autodesk.AutoCAD.Interop
Imports AcadCOMintf = Autodesk.AutoCAD.ApplicationServices.Application
Public Enum eDevType
FullScalePDF = 1
FullScaleXerox = 2
End Enum
Public Class ComPlotSetup
Public Shared oAcadCOMApp As Autodesk.AutoCAD.Interop.AcadApplication = CType(AcadCOMintf.AcadApplication, AcadApplication)
Public Sub New(ByVal oPresentFormatInfo As PresentFormat, ByVal DeviceType As eDevType)
Try
Dim oAcadCOMDoc As Autodesk.AutoCAD.Interop.AcadDocument
oAcadCOMDoc = oAcadCOMApp.ActiveDocument
MsgBox(oAcadCOMDoc.Name)
Catch
End Try
End Sub
End Class
