Creating AutoCAD Subkeys and Values

The ObjectARX application's installation program must be designed to manage a set of keys and values for that application within the section of system registry for each version of AutoCAD with which it is intended to run. This section of the registry must include keys and values identifying the main module of the application and the command set for the application.

The following example shows the layout of the keys and values in the section of the registry that must be created and maintained for the application:

\\HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\releaseNum\
    ACAD-ProductID:LocaleID\
        Applications\
            ApplicationName\
                DESCRIPTION:REG_SZ:User Friendly App Name
                LOADCTRLS:REG_DWORD:acrxAppLoadReason
                LOADER:REG_SZ:DirPathFileName
                Commands\
                    GlobalCommandName1:REG_SZ:LocalCommandName1
                    GlobalCommandName2:REG_SZ:LocalCommandName2
                    GlobalCommandName3:REG_SZ:LocalCommandName3
                    GlobalCommandName4:REG_SZ:LocalCommandName4
                    GlobalCommandName5:REG_SZ:LocalCommandName5
                Groups\
                    GroupName:REG_SZ:GroupName
                    ...

The releaseNum and ACAD-ProductID:LocaleID keys are created by the AutoCAD installation program.

The ApplicationName key must be the logical name of the application, which is used internally by AutoCAD to identify the program.

The value in the LOADER key must include the full path and file name of the module that AutoCAD should load first. The loader module is subsequently responsible for loading any other modules that make up the application.

The acrxAppLoadReason value defines the conditions under which the application will be loaded, using one or more logical ORs of the following hex values listed with their associated meanings:

0x01

Load the application upon detection of proxy object.

0x02

Load the application upon AutoCAD startup.

0x04

Load the application upon invocation of a command.

0x08

Load the application upon request by the user or another application.

0x10

Do not load the application.

0x20

Load the application transparently.

The value in the Groups key may be used to uniquely identify an ObjectARX application's command groups and therefore the commands as well.

The acrxRegisterApp() global function may be used in an ObjectARX application to enter information about the application into the AutoCAD section of the system registry. Typically, acrxRegisterApp() would enter this information the first time the application is loaded, and confirm the presence of that information on subsequent loads.