Command Utility Manual

内容表

关于

A lot of functionality of Cinema 4D is implemented in form of commands. Such commands are plugins based on CommandData . A command is identified by a specific ID that can be used to invoke that command.

注意
The described functions can only be used from the main thread, see Cinema 4D Threads Manual .
The command IDs can easily be obtained from the "Customize Commands" dialog.
These functions wrap around SendCoreMessage() .
For modeling commands see SendModelingCommand() , for UV commands see CallUVCommand() , for painter commands see SendPainterCommand() .

Functionality

These functions exist to access and utilize existing Cinema 4D commands:

// This example prints the name and help text of the given command.
const Int32 commandID = 12098; // save active project
const maxon::String name = GetCommandName (commandID); const maxon::String help = GetCommandHelp (commandID); ApplicationOutput ( "Command \"@\" (@)" _s, name, help);
警告
使用 CallCommand() is the same as pressing the corresponding button in the GUI. This means the command operates on the active document, adds undo-steps and sends messages. So CallCommand() should only be used in response to some user interaction e.g. when a button in a GeDialog was pressed.
// This example checks if the given command is enabled. // If so it is executed. const Int32 commandID = 14047; // subdivide command

// check if the command is enabled (available) if ( IsCommandEnabled (commandID)) { CallCommand (commandID); }

延伸阅读

GetCommandName
String GetCommandName(Int32 id)
maxon::String
定义: string.h:1197
IsCommandEnabled
Bool IsCommandEnabled(Int32 id)
GetCommandHelp
String GetCommandHelp(Int32 id)
CallCommand
void CallCommand(Int32 id, Int32 subid=0)
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
ApplicationOutput
#define ApplicationOutput(formatString,...)
定义: debugdiagnostics.h:207

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1