#include <c4d_commanddata.h>
A data class for creating command plugins. (Previously known as menu plugins.)
Use RegisterCommandPlugin() to register a command plugin. 
|  | 
| virtual Bool | Execute (BaseDocument *doc, GeDialog *parentManager) | 
|  | 
| virtual Bool | ExecuteSubID (BaseDocument *doc, Int32 subid, GeDialog *parentManager) | 
|  | 
| virtual Bool | ExecuteOptionID (BaseDocument *doc, Int32 plugid, Int32 subid, GeDialog *parentManager) | 
|  | 
| virtual Int32 | GetState (BaseDocument *doc, GeDialog *parentManager) | 
|  | 
| virtual Bool | GetSubContainer (BaseDocument *doc, BaseContainer &submenu, GeDialog *parentManager) | 
|  | 
| virtual Bool | RestoreLayout (void *secret) | 
|  | 
| virtual String | GetScriptName () | 
|  | 
| virtual Bool | Message (Int32 type, void *data) | 
|  | 
|  | BaseData () | 
|  | 
| virtual | ~BaseData () | 
|  | 
| void | Destructor () | 
|  | 
◆ Execute()
Executes the command. 
- Parameters
- 
  
    | [in] | doc | The active document. Cinema 4D owns the pointed document. |  
 
- Returns
- true if the command was executed successfully, otherwise false. 
 
 
◆ ExecuteSubID()
Executes the command with the sub-command ID that was given by GetSubContainer(). 
- Parameters
- 
  
    | [in] | doc | The active document. Cinema 4D owns the pointed document. |  | [in] | subid | The sub-command ID. |  
 
- Returns
- true if the command was executed successfully, otherwise false. 
 
 
◆ ExecuteOptionID()
Executes the command when the user calls it through its options dialog. 
- Parameters
- 
  
    | [in] | doc | The active document. Cinema 4D owns the pointed document. |  | [in] | plugid | The command plugin ID. |  | [in] | subid | The sub-command ID. Only available for plugins that have sub-IDs (which normally are called using ExecuteSubID). |  
 
- Returns
- true if the command was executed successfully, otherwise false. 
 
 
◆ GetState()
Called to get the state of the command. 
- Note
- Affects how it is displayed in menus and toolbars. 
- Parameters
- 
  
    | [in] | doc | The active document. Cinema 4D owns the pointed document. |  
 
- Returns
- A combination of the 3 command flags: CMD_ENABLED CMD_VALUE CMD_HIDDEN. 
 
 
◆ GetSubContainer()
Called to get the command sub-menu.
Container submenu is passed to create dynamic sub-container entries. 
- Note
- The menu entries on the top level will all be placed at the point where the command plugin was placed.
 To create a sub-menu, place the entries as sub-containers in the returned container with ID 0. In the sub-container, place a string with ID 1 to name it:
submenu.InsData(0, bc); Definition: c4d_basecontainer.h:47 
void SetString(Int32 id, const maxon::String &s) Definition: c4d_basecontainer.h:569 
 Use &d& and &c& to disable and check items.
- Parameters
- 
  
    | [in] | doc | The active document. Cinema 4D owns the pointed document. |  | [in] | submenu | Fill with the sub-menu structure. |  
 
- Returns
- true if the sub-menu container was filled, otherwise false. 
 
 
◆ RestoreLayout()
  
  | 
        
          | virtual Bool RestoreLayout | ( | void * | secret | ) |  |  | virtual | 
 
Called when loading a layout and restoring async dialogs. 
- Warning
- If implemented then it must create the dialogand calldialog->RestoreLayout.
 If the command has more than one dialog, RestoreLayoutSecret::subid gives the ID of the sub-dialog to restore.
- Note
- If not implemented Cinema 4D will create an empty "???" dialog. 
- Parameters
- 
  
  
- Returns
- true if the dialog was restored, otherwise false. 
 
 
◆ GetScriptName()
  
  | 
        
          | virtual String GetScriptName | ( |  | ) |  |  | virtual | 
 
Called to get the script name of the command. 
- Note
- If implemented the command is stored by name rather than by ID in layouts, shortcuts and menus. 
- Returns
- The script name for the command. 
 
 
◆ Message()
  
  | 
        
          | virtual Bool Message | ( | Int32 | type, |  
          |  |  | void * | data |  
          |  | ) |  |  |  | virtual | 
 
Called to respond to command messages. 
- Parameters
- 
  
    | [in] | type | The message type: MSG_COMMAND |  | [in] | data | The message data. Depends on the command message type. |  
 
- Returns
- true if the message was processed, otherwise false.