AutoCAD commands are stored in groups in the command stack, which is defined by the AcEdCommandStack class. One instance of the command stack is created per AutoCAD session. This stack consists of the custom commands that you have defined. The acedRegCmds() macro gives you access to the command stack.
When you add a command, you also assign it a group name. A good policy is to use your registered developer prefix for the group name to avoid name collisions with other commands. Command names within a given group must be unique, and group names must be unique. However, multiple applications can add a command of the same name, because the group name makes the commands unambiguous.
You usually add commands one at a time with the AcEdCommandStack::addCommand() function, and you remove commands by group with the removeGroup() function. You can also use the removeCmd() function to remove commands one at a time. As part of its cleanup before exiting, your application needs to remove any commands it registered.
The signature for the addCommand() function is
Acad::ErrorStatus addCommand( const char* cmdGroupName, const char* cmdGlobalName, const char* cmdLocalName, Adesk::Int32 commandFlags, AcRxFunctionPtr functionAddr, AcEdUIContext *UIContext = NULL, int fcode=-1, HINSTANCE hResourceHandle = NULL, AcEdCommand** cmdPtrRet = NULL);
ASCII representation of the group to add the command to. If the group doesn't exist, it is created before the command is added.
ASCII representation of the command name to add. This name represents the global or untranslated name (see "Global versus Local Command Names").
ASCII representation of the command name to add. This name represents the local or translated name.
Flags associated with the command. Possible values are ACRX_CMD_TRANSPARENT, ACRX_CMD_MODAL, ACRX_CMD_USEPICKSET, and ACRX_CMD_REDRAW (see "Transparent versus Modal Commands").
Address of the function to be executed when this command is invoked by AutoCAD.
Input pointer to AcEdUIContext callback class.
Input integer code assigned to the command.
Input resource handle to be made current when the command is executed
Input pointer to pointer to be filled in with address of AcEdCommand object for the command being added