King_hxh 发表于 2005-9-1 10:16:00

[求助][ARX]zoom ex的问题

<P>我在一个文件中操作打开一个已经存在的dwg文件,想在打开之后运行zoom ex命令,但是使用acedCommand(RTSTR, "zoom", RTSTR, "ex",0);要么是将原来的那个文件居中了,要么就什么反应都没有,请教各位,应该怎么样才能做到那?</P>
<P>我打开文件的代码为:</P>
<P>void ZffOPENopen1()<BR>{<BR>&nbsp;static char pData[] = "C:\\temp.dwg"; <BR>&nbsp;<BR>&nbsp;acDocManager-&gt;executeInApplicationContext(OpenDoc, (void *)pData);</P>
<P>}</P>
<P>void OpenDoc( void *pData)<BR>{<BR>&nbsp;AcApDocument* pDoc = acDocManager-&gt;curDocument();<BR>&nbsp;pDoc=acDocManager-&gt;curDocument();<BR><BR>&nbsp;if (acDocManager-&gt;isApplicationContext()) <BR>&nbsp;{<BR>&nbsp;&nbsp;acDocManager-&gt;appContextOpenDocument((const char *)pData);<BR>&nbsp;&nbsp;if(!getDocFromFilename( "C:\\temp.dwg",pDoc))<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;AfxMessageBox("不能找到文件!");<BR>&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;if( pDoc )<BR>&nbsp;&nbsp;{<BR><BR>&nbsp;&nbsp;&nbsp;acDocManager-&gt;setCurDocument(pDoc,AcAp::kNone,TRUE);<BR>&nbsp;&nbsp;&nbsp;acedCommand(RTSTR, "zoom", RTSTR, "ex",0);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;AfxMessageBox("不能打开文件!");<BR>&nbsp;} <BR>&nbsp;else<BR>&nbsp;{<BR>&nbsp;&nbsp;acutPrintf("\nERROR To Open Doc!\n");<BR>&nbsp;}<BR>}</P>

huihuo 发表于 2005-9-2 10:18:00

用 sendStringToExecute 试一下

King_hxh 发表于 2005-9-5 10:55:00

<P>问题解决了</P>
<P>多谢huihuo~~</P>
页: [1]
查看完整版本: [求助][ARX]zoom ex的问题