C++
ACAD_PORT bool acedCmdLookup2( const ACHAR* cmdStr, bool globalLookup, AcEdCommandStruc* retStruc, int sf = ACRX_CMD_DEFUN );
File
aced.h
Description
This function is a "C" code wrapper for:
acedRegCmds->lookupCmd2(cmdStr, globalLookup, true, sf);
The ObjectARX command stack is searched for the command cmdStr. If globalLookup is non-zero, then only the global command name list is searched for cmdStr; otherwise, the local command name list is searched.
sf can be set to a bitwise combination of any of the following to indicate which types of commands should be skipped in the search:
ACRX_CMD_MODAL
ACRX_CMD_TRANSPARENT
ACRX_CMD_USEPICKSET
ACRX_CMD_REDRAW
ACRX_CMD_NOPERSPECTIVE
ACRX_CMD_NOMULTIPLE
ACRX_CMD_NOTILEMODE
ACRX_CMD_NOPAPERSPACE
ACRX_CMD_PLOTONLY
ACRX_CMD_NOOEM
ACRX_CMD_UNDEFINED
ACRX_CMD_INPROGRESS
ACRX_CMD_DEFUN
ACRX_CMD_NONEWSTACK
ACRX_CMD_NOINTERNALLOCK
ACRX_CMD_DOCREADLOCK
ACRX_CMD_DOCEXCLUSIVELOCK
ACRX_CMD_SESSION
ACRX_CMD_INTERRUPTIBLE
ACRX_CMD_NOHISTORY
ACRX_CMD_NO_UNDO_MARKER
If the command is found, then its elements are returned in retStruc and 1 is returned to indicate success. If the command is not found, then retStruc->fcnAddr is set to null and 0 is returned to indicate failure.
The AcEdCommandStruc structure is defined in the accmd.h header file as follows:
typedef void (*AcRxFunctionPtr)(); struct AcEdCommandStruc { AcRxFunctionPtr fcnAddr; long flags; void *app; HINSTANCE hResHandle; AcEdCommand *cmd; };
If the command lookup is successful, retStruc->fcnAddr will be set to the address of the function to be executed in the ObjectARX program when the command is executed, retStruc->flags will be set to the command flag bits set for the command (that is, ACRX_CMD_MODAL, ACRX_CMD_TRANSPARENT, ACRX_CMD_USEPICKSET, etc.), retStruc->hResHandle will be set to the command's resource handle (or null if there isn't one), and retStruc->cmd will be set to the AcEdComand object for the command. The app field of retStruc is for AutoCAD internal use only.
Parameters
Parameters | Description |
---|---|
cmdStr | Input command name for which to search |
globalLookup | Input 0 or 1 to indicate to search in global or local name list |
retStruc | Input pointer to an existing AcEdCommandStruc structure |
sf | Input indicating which types of commands should be skipped in the search |