Creating an ObjectARX Application

An ObjectARX application is a DLL that shares AutoCAD's address space and makes direct function calls to AutoCAD. ObjectARX applications typically implement commands that can be accessed from within AutoCAD. These commands are often implemented using custom classes. Creating an ObjectARX application involves the following general steps.

To create an ObjectARX application

  1. Create custom classes to implement new commands.

    You can derive custom classes from most of the ObjectARX hierarchy and symbol table classes.

  2. Determine which AutoCAD messages your ObjectARX application will handle.

    AutoCAD sends a variety of messages to ObjectARX applications, indicating that particular events have occurred within AutoCAD. You decide which messages your application will respond to, and which actions will be triggered.

  3. Implement an entry point for AutoCAD.

    AutoCAD calls into an ObjectARX application through the acrxEntryPoint() function, which replaces the main() function of a C++ program. You are responsible for implementing the acrxEntryPoint() function in your application. The acrxEntryPoint() function calls the functions that you've associated with specific AutoCAD messages.

  4. Implement initialization.

    Within your ObjectARX application, you will need to initialize any custom classes that you have created, and rebuild the ObjectARX runtime class tree. Additionally, if you are adding commands, you must register them with AutoCAD.

  5. Prepare for unloading.

    To create a well-behaved ObjectARX application, you must remove any custom classes and commands when your application is unloaded.

The following sections discuss the general steps of developing an ObjectARX application in more detail.

Note: An ObjectARX Wizard is available for creating ObjectARX projects. See the objectarx\utils directory in the ObjectARX SDK.