19,468
社区成员
发帖
与我相关
我的任务
分享
void DwgToDxf()
{
CString dwgFile = _T("C:\\Documents and Settings\\user\\Desktop\\New Folder\\New Folder\\Drawing1.dwg");
CString dxfFile = _T("C:\\Documents and Settings\\user\\Desktop\\New Folder\\New Folder\\Drawing1.dxf");
AcDbDatabase* pDb = new AcDbDatabase(false,false);
if(pDb->readDwgFile(dwgFile,_SH_DENYRW,false,NULL) != Acad::eOk)
{
acutPrintf(_T("\nfailed to read dwg file"));
delete pDb;
return;
}
if(pDb->dxfOut(dxfFile,16,false) != Acad::eOk)
{
acutPrintf(_T("\nfaile to output dxf file"));
delete pDb;
return;
}
acutPrintf(_T("\nsucessed to output dxf file"));
delete pDb;
}