benjamin0624 发表于 2008-4-26 02:39:00

我是新手,望各位兄弟帮我看看,这段程序片有什么问题?谢谢了!

<p>&nbsp;AcDbDatabase* pOldDb = acdbHostApplicationServices()-&gt;workingDatabase();<br/>&nbsp;AcDbDatabase* pNewDb = new AcDbDatabase();<br/>&nbsp;acdbHostApplicationServices()-&gt;setWorkingDatabase(pNewDb);<br/><br/>&nbsp;''''''//执行数据写入操作<br/>&nbsp;<br/>&nbsp;pNewDb-&gt;saveAs(_T("RouteTable.dwg"));<br/>&nbsp;acdbHostApplicationServices()-&gt;setWorkingDatabase(pOldDb);<br/>&nbsp;delete pNewDb;<br/></p><p>编绎是没问题的,但在加载ARX后,执行此段,报错,访问拒绝,,,</p><p>我把pNewDb-&gt;saveAs(_T("RouteTable.dwg"));注释掉后,运行没反映,但是什么文件也没生成.</p>

DualF 发表于 2008-4-28 18:43:00

<p>你粘贴的啊 !我在这里写的,没有运行,应该没有问题。</p><p>void xb()<br/>{<br/>AcDbDatabase *pDb=new AcDbDatabase();<br/>AcDbBlockTable *pBlkTb;<br/>pDb-&gt;getSymbolTable(pBlkTb,AcDb::kForRead);<br/>AcDbBlockTableRecord *pBlkTbRcd;<br/>pBlkTb-&gt;getAt(ACDB_MODEL_SPACE,pBlkTbRcd,AcDb::kForWrite);<br/>pBlkTb-&gt;close();<br/>AcDbCircle *pCircl=new AcDbCircle(AcGePoint3d(1,1,1),AcGeVector3d(0,0,1),1.0);<br/>AcDbCircle *pCirc2=new AcDbCircle(AcGePoint3d(4,4,4),AcGeVector3d(0,0,1),2.0);<br/>pBlkTbRcd-&gt;appendAcDbEntity(pCircl);<br/>pBlkTbRcd-&gt;appendAcDbEntity(pCirc2);<br/>pCircl-&gt;close();<br/>pCirc2-&gt;close();<br/>pBlkTbRcd-&gt;close();<br/>pDb-&gt;saveAs("tt.dwg");<br/>delete pDb;</p><p>}</p>

DualF 发表于 2008-4-28 18:46:00

<p>CAD&amp;CG讨论群:58756233</p><p>ARX高手、初学者请进,对计算机图形有兴趣请进</p>

benjamin0624 发表于 2008-5-7 18:42:00

还是谢谢你.
页: [1]
查看完整版本: 我是新手,望各位兄弟帮我看看,这段程序片有什么问题?谢谢了!