几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】cannot write out dwg.. but dxf works fine (http://www.dimcax.com/hust/showthread.php?t=15360)

yang686526 2009-05-04 05:31 PM

【转帖】cannot write out dwg.. but dxf works fine
 
cannot write out dwg.. but dxf works fine
cannot write out dwg.. but dxf works fine
afx_manage_state(afxgetstaticmodulestate())
begin_sexception_handling
// create a custom hostappservices object.
odrxobjectimpl<customdwghostservices> svcs;
/*customdwghostservices derived from oddbhostappservices, oddbhostappprogressmeter*/
m_phostservices = svcs.createobject ();
// create a default database
m_pdb = m_phostservices->createdatabase(true, (usemetric == variant_true) ? oddb::kmetric : oddb::kenglish);
odstring filename = "c:\\test.dwg";
odwrfilebuf outfile (filename.c_str ());
m_pdb->writefile (&outfile, oddb::kdwg, oddb::vac15, true, 0);
return s_ok;
end_sexception_handling
please let me know why this code fails. it works fine if i am writing out a dxf file. what could be the difference between writing dwg & dxf.. this code worked fine in 1.14.
thanks.
i could export the files to dwg too now.
thanks


所有的时间均为北京时间。 现在的时间是 06:09 PM.