AutoCAD 2015 and VB.NET

AutoCAD 2015 and VB.NET

Anonymous
Not applicable
1,347 Views
3 Replies
Message 1 of 4

AutoCAD 2015 and VB.NET

Anonymous
Not applicable

Having issues with the following line of code:

Dim ThisDrawing As AcadDocument = DocumentExtension.GetAcadDocument(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument)

 

I have narrowed down the error to the following process:

DocumentExtension.GetAcadDocument()

 

Can anyone please advise on if they are having the same issues? and how they are getting around it?

 

I am using Visual Studio 2010, with 2013 dll's (accoremgd, acdbmgd, acmgd, Autodesk.AutoCAD.Interop, and Autodesk.AutoCAD.Interop.Commom)

with a target framework of .NET 4

 

Any help would be greatly appreciated.

 

Regards

 

Lee

 

 

0 Likes
1,348 Views
3 Replies
Replies (3)
Message 2 of 4

_gile
Consultant
Consultant

Hi,

 

As you're using COM*, I'm afraid you'd have to build a new assembly targeting AutoCAD 2015 libraries and Framework 4.5 which requires Visual Studio 2012.

Another way should be using late binding which avoid referencing the COM libraries.

 

* most plain .NET applications keep on working on A2015 without any change or need to to recompile.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 4

Anonymous
Not applicable

how do you mean COM?

0 Likes
Message 4 of 4

_gile
Consultant
Consultant

I mean the AutoCAD COM interop API referenced by Autodesk.AutoCAD.Interop, and Autodesk.AutoCAD.Interop.Common.

The COM interface is version dependent

 

You can read this:

http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-BFFF308E-CC10-4C56-A81E-C15FB300EB70



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes