-6

I added the references C:\Program Files\Autodesk\AutoCAD 2016\Autodesk.AutoCAD.Interop.dll and C:\Program Files\Autodesk\AutoCAD 2016\Autodesk.AutoCAD.Interop.Common.dll

Getting this error

Error   3   Argument 1: cannot convert from 'Autodesk.AutoCAD.Interop.AcadDocument [h:\CESBRON\Traceur\SmoothProgressBar.cs]' to 'Autodesk.AutoCAD.Interop.AcadDocument'    H:\CESBRON\Traceur\Doc.cs   201 30  Traceur

Why am I having this error? My github: https://github.com/borisdagnon/CESBRON/tree/master/Traceur

Tim
  • 41,901
  • 18
  • 127
  • 145
  • Somewhere in your code you're trying to use `SmoothProgressBar` where a `Doc` is expected. I'm not going to search through the solution for the culprit I'm afraid. Maybe debug it and tell us what line you see it on? Should be a simple fix, though. –  Jan 07 '16 at 11:13
  • I'm also having this error : Error 12 The type 'Autodesk.AutoCAD.Interop.AcadSelectionSet' is defined in an assembly that is not referenced. You must add a reference to assembly 'Autodesk.AutoCAD.Interop, Version=18.0.0.0, Culture=neutral, PublicKeyToken=eed84259d7cbf30b'. H:\CESBRON\Traceur\Automation.cs 42 9 Traceur I want to open autocad 2016 when i select an autocad file. But it always open with the 2010 one. – Boris Newheart Jan 07 '16 at 13:32
  • It tells you what the exact error is. Do what it says. –  Jan 07 '16 at 13:57
  • Do what ? I can't add the version 18.0.0.0 while i want to use autocad 2016. I referenced the assembly : using DLLSelectionSet; – Boris Newheart Jan 07 '16 at 14:13

2 Answers2

0

I would suggest you edit the Traceur.csproj and remove the AutoCAD references between lines 57 and 67, then add again (using Visual Studio >> Add Reference). Note this is, somehow, referencing the 18.0.0, but it should be 20.1 (for AutoCAD 2016).

Also, would also suggest you set your project as 32 or 64 bit specific, as AutoCAD Interop references are not for AnyCPU.

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44
0

I finally found the solution. I decompiled the DLLSelectionset.dll and GetPointCoord.dll and changed the reference of Autodesk.AutoCAD.Interop.dll and Autodesk.AutoCAD.Interop.Common.dll to the Autocad 2016 dlls and recompiled the two dlls. But i want to know if i was right to do that or if there was another solution.

  • if your code depend on other DLLs that also depend on AutoCAD Interop, then yes, you need to recompile all DLLs with updated versions of the references... – Augusto Goncalves Jan 08 '16 at 11:39