Private constructor to enforce singleton pattern. Initializes the command stack with system and default command groups.
StaticDEFAUT_The name of the default user command group
StaticSYSTEMT_The name of the system command group
Adds a command to the specified command group.
The name of the command group. If empty, uses the default group.
The global (untranslated) name of the command. Must be unique within the group.
The local (translated) name of the command. Defaults to global name if empty.
The command object to add to the stack.
Return an iterator that can be used to traverse all of command objects in this command stack (that is, the iterator iterates through all commands in all groups).
Return an iterator that can be used to traverse all of command objects in this command stack.
Search through all of the global and untranslated names in all of the command groups in the command stack starting at the top of the stack trying to find a match with cmdName. If a match is found, the matched AcEdCommand object is returned. Otherwise undefined is returned to indicate that the command could not be found. If more than one command of the same name is present in the command stack (that is, in separate command groups), then the first one found is used.
If a mode is specified, the command is only returned if it is compatible with that mode. Higher value modes are compatible with lower value modes.
Input the command name to search for
Optionalmode: AcEdOpenModeOptional access mode to check compatibility. Only returns the command if it's compatible with this mode.
Return the matched AcEdCommand object if a match is found and compatible with the mode. Otherwise, return undefined.
Search through all of the local and translated names in all of the command groups in the command stack starting at the top of the stack trying to find a match with cmdName. If a match is found, the matched AcEdCommand object is returned. Otherwise undefined is returned to indicate that the command could not be found. If more than one command of the same name is present in the command stack (that is, in separate command groups), then the first one found is used.
If a mode is specified, the command is only returned if it is compatible with that mode. Higher value modes are compatible with lower value modes.
Input the command name to search for
Optionalmode: AcEdOpenModeOptional access mode to check compatibility. Only returns the command if it's compatible with this mode.
Return the matched AcEdCommand object if a match is found and compatible with the mode. Otherwise, return undefined.
Removes all of registered commands
Remove the command with the global and untranslated name cmdGlobalName from the cmdGroupName
command group. Return true if successful. Return false if no command with the global and untranslated
name cmdGlobalName is found in the cmdGroupName command group.
Input the name of the command group containing the command to be removed
Input the command name which is to be removed from cmdGroupName
Return true if successful. Return false if no command with the global and untranslated
name cmdGlobalName is found in the cmdGroupName command group.
Remove the command group with the name GroupName from the command stack and delete the command group
dictionary object and all the AcEdCommand objects stored within it.
Input the name of the command group to be removed from the command stack.
Return true if successful. Return false if no command group is found with the name GroupName.
Fuzzy search for commands by prefix using the command iterator.
This method iterates through all commands in all command groups and returns those whose global or local names start with the provided prefix. The search is case-insensitive. If a mode is specified, only commands compatible with that mode are returned. Higher value modes are compatible with lower value modes.
The prefix string to search for. Case-insensitive.
Optionalmode: AcEdOpenModeOptional access mode to filter commands. Only commands compatible with this mode are returned.
An array of objects containing matched commands and their corresponding group names.
The class to create, define, and register command objects.
It is used to manages all command registration and lookup functionality. Commands are organized into groups, with system commands (ACAD) and user commands (USER) being the default groups.
Example