Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

added 34 characters in body
Source Link
marc_s
  • 760.2k
  • 186
  • 1.4k
  • 1.5k

I'm trying to develop an AutoCAD plugin using the AutoCAD .NET API, but I'm facing a serious issue with DLL references. I'm constantly getting CS0246 and similar "type or namespace not found" errors, and I can't proceed further. I’d really appreciate help from anyone experienced in this area. My Goal

My goal: I I want to dynamically manage block attribute data inside AutoCAD and build a custom rebar detailing system via .NET. I've been doing this for a long time using AutoLISP, but now I want to build a more stable and reliable system using .NET.

Environment: AutoCAD

AutoCAD Versions Tested: 2021, 2023, currently testing with 2017

Visual Studio: 2022 Community (latest version)

.NET Framework: 4.8

Platform Target: x64

Referenced DLLs: acmgd.dll

acmgd.dll
acdbmgd.dll
(Referenced from: C:\Program Files\Autodesk\AutoCAD 2023)

acdbmgd.dll (Referenced from: C:\Program Files\Autodesk\AutoCAD 2023) error codes CS0246: The type or namespace name 'CommandMethod' could not be found
CS0246: The type or namespace name 'Editor' could not be found
CS0246: The type or namespace name 'Document' could not be found
CS0117Error: 'Application' does not contain a definition for 'DocumentManager'
I

CS0246: The type or namespace name 'CommandMethod' could not be found
CS0246: The type or namespace name 'Editor' could not be found
CS0246: The type or namespace name 'Document' could not be found
CS0117: 'Application' does not contain a definition for 'DocumentManager'

I suspect it’sit's related to missing namespaces or improperly loaded DLLs, but I couldn't find a solid solution.

Any advice or working example setup would be greatly appreciated. Thanks in advance to anyone willing to help!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using System.Xml.Linq;
namespace DonatiOtomatik
{
 public class DonatiKomut
 {
 [CommandMethod("TESTKOMUT")]
 public void Yazdir()
 {
 Document doc = Application.DocumentManager.MdiActiveDocument;
 Editor ed = doc.Editor;
 ed.WriteMessage("\nMerhaba .NET dünyası!");
 }
 }
}

I'm trying to develop an AutoCAD plugin using the AutoCAD .NET API, but I'm facing a serious issue with DLL references. I'm constantly getting CS0246 and similar "type or namespace not found" errors, and I can't proceed further. I’d really appreciate help from anyone experienced in this area. My Goal: I want to dynamically manage block attribute data inside AutoCAD and build a custom rebar detailing system via .NET. I've been doing this for a long time using AutoLISP, but now I want to build a more stable and reliable system using .NET.

Environment: AutoCAD Versions Tested: 2021, 2023, currently testing with 2017

Visual Studio: 2022 Community (latest version)

.NET Framework: 4.8

Platform Target: x64

Referenced DLLs: acmgd.dll

acdbmgd.dll (Referenced from: C:\Program Files\Autodesk\AutoCAD 2023) error codes CS0246: The type or namespace name 'CommandMethod' could not be found
CS0246: The type or namespace name 'Editor' could not be found
CS0246: The type or namespace name 'Document' could not be found
CS0117: 'Application' does not contain a definition for 'DocumentManager'
I suspect it’s related to missing namespaces or improperly loaded DLLs, but I couldn't find a solid solution.

Any advice or working example setup would be greatly appreciated. Thanks in advance to anyone willing to help!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using System.Xml.Linq;
namespace DonatiOtomatik
{
 public class DonatiKomut
 {
 [CommandMethod("TESTKOMUT")]
 public void Yazdir()
 {
 Document doc = Application.DocumentManager.MdiActiveDocument;
 Editor ed = doc.Editor;
 ed.WriteMessage("\nMerhaba .NET dünyası!");
 }
 }
}

I'm trying to develop an AutoCAD plugin using the AutoCAD .NET API, but I'm facing a serious issue with DLL references. I'm constantly getting CS0246 and similar "type or namespace not found" errors, and I can't proceed further. I’d really appreciate help from anyone experienced in this area.

My goal: I want to dynamically manage block attribute data inside AutoCAD and build a custom rebar detailing system via .NET. I've been doing this for a long time using AutoLISP, but now I want to build a more stable and reliable system using .NET.

Environment:

AutoCAD Versions Tested: 2021, 2023, currently testing with 2017

Visual Studio: 2022 Community (latest version)

.NET Framework: 4.8

Platform Target: x64

Referenced DLLs:

acmgd.dll
acdbmgd.dll
(Referenced from: C:\Program Files\Autodesk\AutoCAD 2023)

Error:

CS0246: The type or namespace name 'CommandMethod' could not be found
CS0246: The type or namespace name 'Editor' could not be found
CS0246: The type or namespace name 'Document' could not be found
CS0117: 'Application' does not contain a definition for 'DocumentManager'

I suspect it's related to missing namespaces or improperly loaded DLLs, but I couldn't find a solid solution.

Any advice or working example setup would be greatly appreciated. Thanks in advance to anyone willing to help!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using System.Xml.Linq;
namespace DonatiOtomatik
{
 public class DonatiKomut
 {
 [CommandMethod("TESTKOMUT")]
 public void Yazdir()
 {
 Document doc = Application.DocumentManager.MdiActiveDocument;
 Editor ed = doc.Editor;
 ed.WriteMessage("\nMerhaba .NET dünyası!");
 }
 }
}
edited tags
Link
Daniel A. White
  • 191.8k
  • 49
  • 389
  • 474
Source Link

Class Library (.NET Framework) AutoCAD DLL Reference Issue — CS0246 Errors

I'm trying to develop an AutoCAD plugin using the AutoCAD .NET API, but I'm facing a serious issue with DLL references. I'm constantly getting CS0246 and similar "type or namespace not found" errors, and I can't proceed further. I’d really appreciate help from anyone experienced in this area. My Goal: I want to dynamically manage block attribute data inside AutoCAD and build a custom rebar detailing system via .NET. I've been doing this for a long time using AutoLISP, but now I want to build a more stable and reliable system using .NET.

Environment: AutoCAD Versions Tested: 2021, 2023, currently testing with 2017

Visual Studio: 2022 Community (latest version)

.NET Framework: 4.8

Platform Target: x64

Referenced DLLs: acmgd.dll

acdbmgd.dll (Referenced from: C:\Program Files\Autodesk\AutoCAD 2023) error codes CS0246: The type or namespace name 'CommandMethod' could not be found
CS0246: The type or namespace name 'Editor' could not be found
CS0246: The type or namespace name 'Document' could not be found
CS0117: 'Application' does not contain a definition for 'DocumentManager'
I suspect it’s related to missing namespaces or improperly loaded DLLs, but I couldn't find a solid solution.

Any advice or working example setup would be greatly appreciated. Thanks in advance to anyone willing to help!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using System.Xml.Linq;
namespace DonatiOtomatik
{
 public class DonatiKomut
 {
 [CommandMethod("TESTKOMUT")]
 public void Yazdir()
 {
 Document doc = Application.DocumentManager.MdiActiveDocument;
 Editor ed = doc.Editor;
 ed.WriteMessage("\nMerhaba .NET dünyası!");
 }
 }
}
lang-cs

AltStyle によって変換されたページ (->オリジナル) /