Tuesday, August 7, 2012

How to Load AutoCAD.Net Plugin Dlls automatically?

If you are developing AutoCAD.Net plugins, then to load your .Net Plugin Dll, you have to do use "NetLoad" command and specify your Plugin Dll, each time you want to load it. And in a developer's life, you have to compile/debug code lots of times and so have to issue NetLoad lots of time as well and realy it is getting annoying thing.

I searched for some solution to either automate NetLoad command e.g. see this post which is using LISP Routines to automate the NetLoad, or somehow, AutoCAD should pick it automatically when it starts, as this Plugin dll is part of AutoCAD.

Using Lisp routine method give me some problem that it was calling it 2 or 3 times and I was not able to understand why. This also involves my laziness to investigate LISP behavior (you know LISP is bit rusty procedural style language). So I rejected that because that was hanging AutoCAD on my machine. Annoyed

However, I found this very good post about Automatic loading of .NET modules (by Kean Walmsley) about using Registry to let AutoCAD load our plugin dlls. Although, initially you have to create your registry keys manually but then you can export your registry keys to .reg file and modify and update using any Text Editor. I found this method more convenient and have not faced any problem like in case of LISP routines.

No comments: