acedCommand在按扭事件中无法执行
acedCommand(...,"open",0),直接在一个ARX命令函数中可以执行,但如果是在 窗口上的一个button的onclick事件中执行该代码,则无法运行(模式和无模式窗口都不行,用的是CDialog) 是你自己的问题,setFocus转换焦点
文档中有介绍:
Avoiding Problems with NEW and OPEN
To avoid loss of synchronization between the AutoCAD and ARX communication interface, do not pass acedCommand() or acedCmd() NEW or OPEN. Instead, pass a script that executes NEW and OPEN, answers the prompts, and calls a function in the ARX application to return control to the ARX application.
就是说无论如何acedCommand也不能用以OPEN和NEW命令
acedGetAcadWinApp()->OpenDocumentFile( filename );
试试看上面代码,可以和open命令一样的。
用acDocManager->sendStringToExecute()函数执行
如:
acDocManager->sendStringToExecute(acDocManager->curDocument(),
"line 0,0 1,1 \n",false, true);
页:
[1]