pjl110 发表于 2006-5-10 17:42:00

[求助][ARX]请问一下关于屏幕刷新?

<P>readfromfile()</P>
<P>{</P>
<P>AcDbDatabase *pDb=new AcDbDatabase();<BR>&nbsp;&nbsp;Acad::ErrorStatus es=pDb-&gt;readDwgFile ("e:\\3.dwg");<BR>&nbsp;&nbsp;if(es!=Acad::eOk)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;acutPrintf("Fail load dwg file.code:1");<BR>&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;AcDbBlockTable *pBlockTable;<BR>&nbsp;&nbsp; es=pDb-&gt;getBlockTable (pBlockTable,AcDb::kForWrite );<BR>&nbsp;&nbsp;if(es!=Acad::eOk)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;acutPrintf("Fail load AcDbBlockTable.code:2");<BR>&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;AcDbBlockTableRecord *pBlockTableRecord;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;AcDbObjectId Id;<BR>&nbsp;&nbsp;es=pBlockTable-&gt;getAt ("10",pBlockTableRecord,AcDb::kForRead );<BR>&nbsp;&nbsp;if(es!=Acad::eOk)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;acutPrintf("Fail found special block!.code:3");<BR>&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;acutPrintf("Sucessfully find the block!\n");<BR>&nbsp;&nbsp;&nbsp;AcDbBlockTableRecordIterator* pBTRIterator;<BR>&nbsp;&nbsp;&nbsp;es=pBlockTableRecord-&gt;newIterator (pBTRIterator);<BR>&nbsp;&nbsp;&nbsp;if(es!=Acad::eOk )<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;acutPrintf("Fail to construct BlockTableRecord Iterator.code:4");<BR>&nbsp;&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;int No=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;for(pBTRIterator-&gt;start ();!pBTRIterator-&gt;done ();pBTRIterator-&gt;step ())<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AcDbEntity *pEnt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int ReadOrWrite=1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;es=pBTRIterator-&gt;getEntity(pEnt,AcDb::kForWrite ); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(es!=Acad::eOk)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;acutPrintf("Fail to find the Entity in No:%i,.code:5",No);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(ReadOrWrite==1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;acutPrintf("And it is opened for write!\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 如果当前实体是以AcDb::kForWrite方式打开的,则要这样做&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pEnt-&gt;downgradeOpen();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pEnt-&gt;draw();&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}//if<BR>&nbsp;&nbsp;&nbsp;&nbsp;}//for<BR>&nbsp;&nbsp;&nbsp;&nbsp;acutPrintf("The Record contain %i blocks!",No);<BR>&nbsp;&nbsp;&nbsp;&nbsp;// 刷新显示屏幕&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;actrTransactionManager-&gt;flushGraphics();&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;acedUpdateDisplay();&nbsp; </P>
<P>&nbsp;&nbsp;&nbsp;}</P>
<P>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;pBlockTable-&gt;close ();<BR>&nbsp;&nbsp;pBlockTableRecord-&gt;close ();<BR>&nbsp;&nbsp;delete pDb;<BR>&nbsp;&nbsp;return;<BR>}</P>
<P>请问我的这段代码为什么刷新不了显示屏啊?</P>
<P>谢谢!</P>

瑞昭月华 发表于 2014-5-24 19:12:37

8年了,都没人能解释下吗?8年后的今天,又有新人同问为什么没有效果??
    // 刷新显示屏幕
    actrTransactionManager->flushGraphics();
    acedUpdateDisplay();
页: [1]
查看完整版本: [求助][ARX]请问一下关于屏幕刷新?