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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 06:40 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】nothing in my dwf file

nothing in my dwf file
nothing in my dwf file
there is nothing in my dwf file when i look at it in autocad's viewer.
i am getting multiple codeguard errors: bad parameter - a bad file or pipe stream (0x1623244) has been passed to the function. the call stack shows zipopen() any ideas?
my dwg/dxf export creates the files ok (it bombs on oduninitialize(), but that is another story.)
m_pdbw->layerid = 0;
delete m_pdbw;
m_pdbw = null;
if (m_filetype == ftdwf)
{
try
{
dwexportparams params;
params.binkedarea = false; // mku 1/21/2004
params.bcolormapoptimize = false; // mku 1/21/2004
params.format = dw_uncompressed_binary;
params.version = ndwf_v60;
if (!m_pdb.isnull())
{
params.pdb = m_pdb;
params.sdwffilename = m_filename.c_str();
params.background = odrgb(255, 255, 255);
params.ppalette = odcmacadlightpalette();
exportdwf(params);
}
}
catch (oderror& err)
{
odstring msg = m_svcs.geterrordescription(err.code());
// std(cout) << "dwgdirect error: " << msg.c_str() << std(endl) << std(endl);
return false;
}
catch (...)
{
// std(cout) << "unknown error." << std(endl) << std(endl);
return false;
}
}
else
{
try
{
odstreambufptr fb;
try
{
fb = m_svcs.createfile(
m_filename.c_str(),
oda::kfilewrite,
oda::ksharedenyno,
oda::kcreatealways);
}
catch(const oderror_fileexception& err)
{
qsmessage::error("unable to create file.\n is the file currently open in another program?");
bret = false;
}
if (fb != null)
{
if (m_filetype==oddb::kdxf)
{
m_pdb->writefile(fb, oddb::kdxf, oddb::vac18, false );
}
else
{
m_pdb->writefile(fb, oddb::kdwg, oddb::vac18, false );
};
}
}
catch (...)
{
int i = 1;
//bret = false; can't get rid of this exception, but the file still writes
}
}
// m_pdb->release(); generates an exception
//m_pdb = null;
return bret;
attached files
send, please, a source file.
misha kuzinets
in addition, did you try to run oddwfexportex with your file?
misha kuzinets
the file i am exporting...
the file i am exporting is not in an autocad format. it is a very simple file with two layers of a dozen or so 3d polylines. i am using the source above plus:
(see attached files for full .cpp and .h file)
//---------------------------------------------------------------------------
void qscadexport::exportpolylinebegin()
{
// add a 3d polyline with vertices.
m_pdbw->p3dpl = oddb3dpolyline::createobject();
m_pdbw->p3dpl->setlayer(m_pdbw->layerid, false);
}
//---------------------------------------------------------------------------
void qscadexport::exportpolylinevertex(const qspoint& p1)
{
oddb3dpolylinevertexptr pv3 = oddb3dpolylinevertex::createobject();
m_pdbw->p3dpl->appendvertex(pv3);
odgepoint3d pos(p1.x, p1.y, p1.z);
pv3->setposition(pos);
}
//---------------------------------------------------------------------------
void qscadexport::exportpolylineend()
{
oddbblocktablerecordptr pblock = m_pdb->getmodelspaceid().safeopenobject(oddb::kforwrite) ;
pblock->appendoddbentity(m_pdbw->p3dpl);
// m_pdbw->p3dpl->release(); generates an exception
m_pdbw->p3dpl = null;
}
//---------------------------------------------------------------------------
last edited by dan quinn; 11th august 2005 at 06:25 amfff">.
dan,
i've checked oddwfexportex sample for dd 1.13.02. it works.
i think you have an ability for getting dwg as intermediate result. i'd prefer to look at dwg at first. i hope it does not give a lot of troubles.
misha kuzinets
dwg attached
i don't know how to create the intermediate file, but here is the one i exported to .dwg format. note you have to zoom to the extents to see the drawing.
attached files (13.6 kb, 4 views)

attached files
the .cpp and .h did not attach, let me try again.
attached files (4.5 kb, 8 views)

last edited by dan quinn; 11th august 2005 at 06:50 amfff">.
the dwf file is not empty. this is a correct file. but none enty got into the file. it's happened because model space entites is cliped by active view. set view before export.
misha kuzinets
set the view?
what is the method for setting the view? is it in one of the sample projects?
quote:
originally posted by dan quinn
what is the method for setting the view? is it in one of the sample projects?
yes, samples keep some decisions.
for instance, you can execute zoomextents.
misha kuzinets
i am confused
how do you stop the active view from clipping?
does one of the sample projects show how to set the view dimensions?
zoomextents worked
zoomextents worked, thanks
m_pdb->settilemode(1); // 0 for paperspace, 1 for modelspace
oddbviewporttableptr pvptbl = m_pdb->getviewporttableid().safeopenobject();
oddbobjectid id = pvptbl->getactiveviewportid();
if (id)
{
oddbviewporttablerecordptr prec = id.safeopenobject(oddb::kforwrite);
prec->zoomextents();
}
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】it cant read dwf-file when the dwf version is 60 yang686526 DirectDWG 0 2009-05-06 04:26 PM
【转帖】export to dwf v6.0 not working in oddwfexportex - dd rel 2.2 yang686526 DirectDWG 0 2009-05-05 10:27 AM
【转帖】exception in materializefile loading dwf file yang686526 DirectDWG 0 2009-05-05 09:58 AM
【转帖】dwf printing problems yang686526 DirectDWG 0 2009-05-05 07:51 AM
【转帖】dwf forma yang686526 DirectDWG 0 2009-05-04 08:23 PM


所有的时间均为北京时间。 现在的时间是 05:22 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多