Monday, September 20, 2010

IDE For Custom Apps!

As we continue to lay down the stepping stones for building a streamlined design environment, I would like to interject one of my favorite activities - developing custom AutoCAD applications (apps). The apps that we develop will fit seamlessly into our environment without having to re-configure or install anything on the client machines.

Before we develop our first app however, we should briefly discuss the development environment. A few years ago I transitioned from developing AutoCAD apps in the LISP environment to using C#.net. The AutoCAD API offers some very powerful control for developing custom apps.

To get started with C#.net you can download the Microsoft Visual Studio Express environment for free!

Install Visual C# Express Edition.

Launch Visual C# Express Edition.

Create a new project by selecting File -> New Project 

Select Class Library as the template for the new project and select OK.

You should now have a new solution that looks like this:

In the Solution Explorer (right side of screen) expand References.

Right click on References and select Add Reference.


Select the Browse tab on the Add Reference dialog box. Then browse to the install folder of AutoCAD (i.e. C:\Program Files\AutoCAD 2010\

From this location we will add two .dll files that will provide the AutoCAD API to develop custom apps in the .net environment. The two files are:

acdbmgd.dll
acmgd.dll

You can select and load both files at the same time. You should now see these added in your References list.

One more step before we can create a custom AutoCAD app! Highlight both of the newly added references and below the Solution Explorer in the Properties pane set Copy Local to False.


This is the basic setup for a new custom AutoCAD app. Here are two excellent resources to find more detailed information and sample code:

2. Through The Interface

In my next post we will develop a layer creation app.





No comments:

Post a Comment