The original "AutoCAD Managed C# 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, the version of "System.dll" assembly and "System.Data.dll" assembly is 1.0, but in Visual Studio .NET 2003 we need version 1.1. So, I decided to rewrite the wizard to solve these problems. Download the files in the attachment and unzip them. Then copy the folder "VC#" to the directory: \Program Files\Microsoft Visual Studio .NET 2003\.
- Invoke Visual Studio .NET 2003 IDE then start a new project. Select the node "Visual C# Projects" and click on the template "New AutoCAD Managed CS Project Application" as shown below:
- Type in a project name, here we enter "Test". Set the location where you want the project to be created. Select OK. The "AutoCAD Managed CSharp Application Wizard For AutoCAD2006" dialog will then appear. Enter your Registered Developer Symbol (RDS). Here we enter "arx". For more information on Registered Developer Symbols (RDS) go to this URL.
- Select the tab "NameSpace" and check the checkbox before the name of the namespace you want to include in your application. Note: "
Autodesk.AutoCAD.Runtime" and "
Autodesk.AutoCAD.DatabaseServices" are automatically added to your application. "
Autodesk.AutoCAD.EditorInput" and "
Autodesk.AutoCAD.DatabaseServices.TransactionManager" 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.
- Select the tab "CommandMethod and Commit" to define the name of the
CommandMethod attribute. The wizard will add a function that we can use for our command, and give it the same name as the
CommandMethod attribute. In this tab, you can also add summary description for the class and determine whether to have a constructor of the class or not (by default, the class will have a constructor).
- Select the tab "Unmanaged Option" to determine whether to use unmanaged code or not.