I\'m developing an AutoCAD add-in, which uses a .NET 4.6 assembly. I am finding the development process very frustrating; the API is very large and the documentation beyond
You can run a script at debug to NETLOAD your DLL with the /b commandline switch.
Add something like the following to the end of what you already have in the Command line arguments text box in Visual Studio
/b "C:\Path\To\Script\AutoNetLoadDebug.scr"
The script called AutoNetLoadDebug.scr
has contents are something like
netload "C:\Path\To\Dll\Your.dll"
Note: there needs to a line feed at the end of that line so it actually runs the command. Make sure you don't have AutoCAD set up to already load that DLL or a different build of it. If you do, launch AutoCAD with a different profile using the /p
command line switch.
You can't run anything from the AutoCAD API outside of AutoCAD, the .NET DLLs are just mappings of the unmanaged code deep in the bowels of AutoCAD
I do lots of logging (Serilog), especially in debug. There's also CADtest on Github as well as https://github.com/wtertinek/AcadTestRunner. I tried once to Mock the AutoCAD API. Once. Hence, CADtest.
Protip: try-catch everywhere and watch for nulls but you have probably already discovered that.
Read the AutoCAD Tag wiki and have a look at the other forums and blogs mentioned there, they are goldmine of AutoCAD API knowledge