才鸟的AutoCAD专栏

专门研究.NET开发AutoCAD及AutoCAD2009新功能

原创 Enhanced AutoCAD .NET Project Application Wizard收藏

新一篇: 2分钟亲密接触AutoCAD 2009  | 旧一篇: [AutoCAD2008新功能介绍4]利用.NET使AutoCAD对象可缩放

The original "AutoCAD Managed application wizard" is very simple. Only the "Autodesk.AutoCAD.Runtime" namespace is imported, but the ObjectARX application often needs other namespaces such as "Autodesk.AutoCAD.DatabaseSevices" and "Autodesk.AutoCAD.ApplicationSevices". Furthermore, you must type "netload" to load the built assembly.

So, I decided to rewrite the wizard to solve these problems.

Note:There are different versions for Visual Studio 2005/2008 and C#/VB 2008 express edition.In the following demonstration,I will select Visual Studio 2008.

1.Download the suitable version from http://www.codeplex.com/dotnetarx,then unzip it.Double click the .msi setup file,and install the wizard.

2.Invoke Visual Studio 2008 IDE then start a new project. Select the node "ObjectARX" under "Visual C# Projects" and click on the template "AutoCAD Managed CS Project Application" as shown below:

3.Type in a project name, here we enter "Test". Set the location where you want the project to be created. Select OK. The "Managed C# Application Wizard For AutoCAD2008" dialog will then appear.

4.You can select the AutoCAD version,open a drawing when AutoCAD is launched,add the AutoCAD COM reference to your program, and enable Unmaged debugging.

5.Select the tab "Assemblies&Namespaces" and check the checkbox before the name of the assembly and namespace you want to include in your application. Note: "Autodesk.AutoCAD.Runtime" ,"Autodesk.AutoCAD.DatabaseServices" ,"Autodesk.AutoCAD.ApplicationServices", "Autodesk.AutoCAD.EditorInput" are checked by default because they are often included in the ObjectArx applications, you can uncheck them if your application does not need these namespaces.

6.Select the tab "Class" to add summary description for your application and the common used variables such as db,ed,and trans.

7.Click "Finish" to accept the settings you have selected.

8.Press F5 to debug your application,the correct version of AutoCAD will be launched.You don't need to type "netload",just type the command name you will get the result!

发表于 @ 2007年12月07日 21:59:00|评论(loading...)|编辑

新一篇: 2分钟亲密接触AutoCAD 2009  | 旧一篇: [AutoCAD2008新功能介绍4]利用.NET使AutoCAD对象可缩放

评论:没有评论。

发表评论  


当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
Csdn Blog version 3.1a
Copyright © C#才鸟