CAD向控件注册一个命令
_DMxDrawX::RegistUserCustomCommand
向控件注册一个命令,用户在命令行输入命令名这个字符串,就会触发执行命令事件 命令事件的id就是该注册时的id值,成功返回true。详细说明如下:
| 参数 | 说明 |
|---|---|
|
BSTR pszCommandName |
命令名称 |
|
LONG lId |
命令id |
点击按钮,向控件注入自定义命令,在命令栏输入js中设置好的命令名称,就会打开打印对话框。
|
1
2
3
4
5
6
7
8
|
//设置自定义命令调用打印if (iCmd == 600) { mxOcx.RegistUserCustomCommand("00",111); mxOcx.Focus();}else if (iCmd == 111) { UserPrint(); } |
|
1
2
3
|
function UserPrint() { mxOcx.SendStringToExecute("Plot");} |
浙公网安备 33010602011771号