User Interface and Database Access

ObjectDBX allows you to write separate binaries for the database (DB) and user-interface (UI) portions of your application. The file containing the UI component has the extension bundle and contains the AutoCAD-specific code that issues prompts, displays dialog boxes, modifies menus, and so forth. The DB component file (the Object Enabler) has the extension .dbx and contains the non-AutoCAD-specific code that implements custom objects by creating them, displaying them, transforming them, and so on. If your application is separated into user-interface and database portions, your custom objects will still be handled properly without the presence of the ObjectARX application that provided the user interface.

Note:

If your custom objects have AutoCAD-specific dependencies (such as on an AutoCAD system variable that is not stored in the database), then you cannot put the code for those objects in a DBX file. The DB code will need to be in an ARX file as well. In that case, you can keep the DB and UI code separate in two ARX files, or you can put the UI and DB code together in the same ARX file.

For example, suppose you implement a custom object called “Sink,” and the code to display and modify Sink is in sink.dbx, while the code to prompt the user for Sink creation values is in sink.arx. Your user can load sink.arx from AutoCAD and use it (with sink.dbx, which is loaded automatically) to create a custom sink in a drawing. Later, that drawing can be loaded by any other host application (including AutoCAD), and if the user has a copy of the sink.dbx file available, the Sink objects will display properly, instead of as proxies.

Danger: Using the Microsoft __declspec(dllimport) linker directive to share a single header file between ObjectARX and ObjectDBX modules can cause unwanted results. See the “Known Issues and Limitations” section of the ObjectARX Readme for suggestions on safe usage of this directive.