.NET

Reply
Distinguished Contributor
cadcamm99
Posts: 158
Registered: ‎04-12-2005
Message 1 of 2 (533 Views)
Accepted Solution

2014 conversion

533 Views, 1 Replies
09-06-2013 12:02 PM

I am converting my programs from 2012 to 2014. I am using VB.Net 2010.  I ran into this problem with this code.  I received the error: 'AcadDocument' is not a member of 'Autodesk.AutoCAD.ApplicationServices.Document'.

 

I put Core after ApplicationServices but that did not fix it.  Any clues?

 

Imports System Imports Autodesk.AutoCAD

Imports Autodesk.AutoCAD.Runtime

Imports Autodesk.AutoCAD.ApplicationServices

Imports Autodesk.AutoCAD.DatabaseServices

Imports Autodesk.AutoCAD.Interop

Imports Autodesk.AutoCAD.Interop.Common

 

Public Class myCustomProperties

     Public ReadOnly Property ThisDrawing() As AcadDocument

          Get            

               Return Autodesk.AutoCAD. _

               ApplicationServices.Application. _ 

               DocumentManager.MdiActiveDocument.AcadDocument

          End Get

     End Property

End Class

 

 

Hi,

 

Since A 2013, the Document.AcadDocument property have been replaced by the GetAcadDocument() extension method deined in the DocumentExtension module which needs to be imported.

 

Imports System Imports Autodesk.AutoCAD
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension
Public Class myCustomProperties
Public ReadOnly Property ThisDrawing() As AcadDocument
Get
Return Application.DocumentManager.MdiActiveDocument.GetAcadDocument()
End Get
End Property
End Class

 

*Expert Elite*
_gile
Posts: 2,103
Registered: ‎04-29-2006
Message 2 of 2 (527 Views)

Re : 2014 conversion

09-06-2013 01:03 PM in reply to: cadcamm99

Hi,

 

Since A 2013, the Document.AcadDocument property have been replaced by the GetAcadDocument() extension method deined in the DocumentExtension module which needs to be imported.

 

Imports System Imports Autodesk.AutoCAD
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common

Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension

Public Class myCustomProperties
     Public ReadOnly Property ThisDrawing() As AcadDocument
          Get            
               Return Application.DocumentManager.MdiActiveDocument.GetAcadDocument()
          End Get
     End Property
End Class

 

Gilles Chanteau
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.