.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2014 conversion

1 REPLY 1
SOLVED
Reply
Message 1 of 2
cadcamm99
2845 Views, 1 Reply

2014 conversion

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

 

 

1 REPLY 1
Message 2 of 2
_gile
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
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost