Thanks Alfred,
DocumentExtension worked for me.
I have to make a code of my ex-colleague usable for AutoCAD 2015, so i don't have much experience with the code.
The problem is that he declared tAcadDoc as editor.
If i use your code i wont get that error anymore (tAcadDoc --> doc1) (tAcadDocCOM --> ed) but it gives me extra errors after it.
Dim ed as ApplicationServices.Document
Dim doc1 as Interop.AcadDocument
ed = ApplicationServices.Application.DocumentManager.MdiActiveDocument
doc1 = CType(ApplicationServices.DocumentExtension.GetAcadDocument(ed), Interop.AcadDocument)
Old code:
Dim doc1 As Autodesk.AutoCAD.Interop.AcadDocument = Application.DocumentManager.MdiActiveDocument.AcadDocument
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Because ed is now declared as ApplicationServices.Document, i can't use for example ed.WriteMessage because it's not declared as editor anymore:
ed.WriteMessage(vbCrLf & "Initializing - Loading User Preferences - ST-CadCommands." & vbCrLf)
I tried to declare ed as editor but then it says that it can't convert ApplicationServices.Application.DocumentManager.MdiActiveDocument to EditorIput.Editor
I have added accoremgd, acdbmgd, AcDx, Acmgd, AutoCAD, Interop, Interop.Common and AXDBLib to the references
Can you help me further?
Arjan