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