acedCommand在按扭事件中无法执行
acedCommand(...,"open",0),直接在一个ARX命令函数中可以执行,但如果是在 窗口上的一个button的onclick事件中执行该代码,则无法运行(模式和无模式窗口都不行,用的是CDialog) <p>是你自己的问题,</p><p>setFocus转换焦点</p> <p>文档中有介绍:</p><p>Avoiding Problems with NEW and OPEN</p><p>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.</p><p>就是说无论如何acedCommand也不能用以OPEN和NEW命令</p> <font size="2"><p>acedGetAcadWinApp()->OpenDocumentFile( filename );</p><p>试试看上面代码,可以和open命令一样的。</p></font> <p>用acDocManager->sendStringToExecute()函数执行</p><p>如:</p><p>acDocManager->sendStringToExecute(acDocManager->curDocument(),<br/> "line 0,0 1,1 \n",false, true);</p>
页:
[1]