Keith511 发表于 2007-6-21 10:08:00

readDwgFile和dxfin的问题

<p>void test()<br/>{<br/>&nbsp;AcDbDatebase *pDb=acdbCurDwg();</p><p>&nbsp;CString strPath = "C:\\test.dxf";<br/>&nbsp;Acad::ErrorStatus es;<br/>&nbsp;es = pDb-&gt;dxfOut(strPath);<br/>&nbsp;AcDbDatabase *pDxfDB = new AcDbDatabase;<br/>&nbsp;acdbHostApplicationServices()-&gt;setWorkingDatabase(pDxfDB);<br/>&nbsp;es = pDxfDB-&gt;readDwgFile(strPath);<br/>&nbsp;if ( es != Acad::eOk)<br/>&nbsp;{<br/>&nbsp;&nbsp;AfxMessageBox("readDwgFile error!");<br/>&nbsp;&nbsp;es = pDxfDB-&gt;dxfIn(strPath);<br/>&nbsp;&nbsp;if ( es!= Acad::eOk )<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;AfxMessageBox("dxfin errofr!");<br/>&nbsp;&nbsp;}</p><p>&nbsp;}<br/>&nbsp;return TRUE;<br/>}</p><p></p><p>将dwg存为dxf,然后在打开时候有问题</p><p></p><p></p>

lidingyu 发表于 2007-6-30 16:40:00

是这样的,有谁来解

bluelightcsy 发表于 2007-7-5 19:41:00

readDwgFile只能读dwg后缀的文件,DWF是不行的,所以知道是DWF的话根本不用readDWGFile这个。。。

bluelightcsy 发表于 2007-7-5 19:45:00

Keith511发表于2007-6-21 10:08:00static/image/common/back.gifvoid test(){&nbsp;AcDbDatebase *pDb=acdbCurDwg();&nbsp;CString strPath = \"C:\\test.dxf\";&nbsp;Acad::ErrorStatus es;&nbsp;es = pDb-&gt;dxfOut(strPath);&nbsp;AcDbDatabase *pDxfDB

<p>你两个都能返回eOK?是DXF不是DWF啊,看错了。。。AcDbDataBase有一个SaveAs试试那个。你调用ACAD文件的SAVEAS肯定能成功吧,如果AcDbDataBase不行,就试试,文档类的方法</p>
页: [1]
查看完整版本: readDwgFile和dxfin的问题