.NET

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

2014 conversion

395 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

 

 

*Expert Elite*
_gile
Posts: 2,072
Registered: ‎04-29-2006
Message 2 of 2 (389 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community