几何尺寸与公差论坛------致力于产品几何量公差标准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-04, 08:23 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】dwf forma

dwf format
dwf format
hi,
i am trying to create a dwf format file but i can't create it. if i use dwf version 6 then i don´t have any file. if i use dwf version 5.5 and 4.2 then i get a file but this file is incorrect (there are nothing).
can i do?
thank you.
have you looked into oddwfexportex sample?
is it possible to reproduce your problem in it?
sergey slezkin
dwf problems
quote:
originally posted by sergey slezkin
have you looked into oddwfexportex sample?
is it possible to reproduce your problem in it?
yes, but it's insufficent.
i use sample code and it is exported:
(dwf v00.42)
(endofdwf)
gabriel,
it's look like on exception during the dwf export. could you check your settings into dwexportparams? for instance, the such thing could be happened in case ppalette parameter is null. it could be a reason for exception. or another exception could be thrown because of incorrect parameters.
misha kuzinets
dwf problems
quote:
originally posted by misha kuzinets
gabriel,
it's look like on exception during the dwf export. could you check your settings into dwexportparams? for instance, the such thing could be happened in case ppalette parameter is null. it could be a reason for exception. or another exception could be thrown because of incorrect parameters.
i have the next code:
code:
try
{
exportdwf(param);
}
catch(oderror e)
{
int code;
code = e.code();
}
and i get no errors.
help me, please.
gabriel,
as i see you should have following code at least:
...
dwexportparams params;
params.pdb = ....;
params.sdwffilename = ....;
params.version = ndwf_v42; // default value is ndwf_v55
exportdwf(params);
...
about errors. some exceptions (dwfresult and wt_result from whiptk6) could be processed inside dwfexport. the corresponding message is given in std::cout in this case. any oderror exception will be thrown.
describe your params with more details, please.
also tell me please more about using environment (os, dwgdirect libraries...)
misha kuzinets
quote:
originally posted by misha kuzinets
gabriel,
as i see you should have following code at least:
...
dwexportparams params;
params.pdb = ....;
params.sdwffilename = ....;
params.version = ndwf_v42; // default value is ndwf_v55
exportdwf(params);
...
about errors. some exceptions (dwfresult and wt_result from whiptk6) could be processed inside dwfexport. the corresponding message is given in std::cout in this case. any oderror exception will be thrown.
describe your params with more details, please.
also tell me please more about using environment (os, dwgdirect libraries...)
i don't use more params. my os is windows and dwgdirect libraries are 1.11 beta.
about errors. my aplication is a graphical program and i can't see std::cout. how can i see error messages?
thank you.
have you odamfcapp? have you the same result with odamfcapp?
windows. which?
librareis or dll. for ms vc++ 6.0 ? for c++builder 6 ?..
have you this result with any file?
i am sorry so misunderstanding whether you have any dwexportparams initialization. please, send me your code starting with oddbdatabase* reference declaration and initialization.
misha kuzinets
quote:
originally posted by misha kuzinets
have you odamfcapp? have you the same result with odamfcapp?
windows. which?
librareis or dll. for ms vc++ 6.0 ? for c++builder 6 ?..
have you this result with any file?
i am sorry so misunderstanding whether you have any dwexportparams initialization. please, send me your code starting with oddbdatabase* reference declaration and initialization.
sorry, i did´nt understanded you.
code:
void export_dwf_database(
oddbdatabaseptr database,
const char *namefile)
{
dwexportparams params;
oddbextents sizedb;
double xsize, ysize;

sizedb.addblockext(database->getmodelspaceid().safeopenobject(oddb::kforread));
xsize = sizedb.maxpoint().x - sizedb.minpoint().x;
ysize = sizedb.maxpoint().y - sizedb.minpoint().y;
params.pdb = database;
params.sdwffilename = odstring(namefile);
params.binkedarea = false;
params.bcolormapoptimize = false;
params.format = dw_ascii;
params.version = ndwf_v42;
params.xsize = (long)xsize;
params.ysize = (long)ysize;
try
{
exportdwf(params);
}
catch(oderror error)
{
int code;
code = error.code();
}
}
windows. which? 98
librareis or dll. for ms vc++ 6.0
have you this result with any file? yes.
have you the same result with odamfcapp? no.
xsyze & ysize have no concern here with any layout extents. they set dwf file resolution. modifying xsyze & ysize you can change dwf export quality. it could be useful to zoom in. also file size depends on resolution. the less resolution is the less file size is. and vice versa.
try to use xsyze & ysize default values at the beginning, please.
i am waiting your results.
misha kuzinets
dwf format
quote:
originally posted by misha kuzinets
xsyze & ysize have no concern here with any layout extents. they set dwf file resolution. modifying xsyze & ysize you can change dwf export quality. it could be useful to zoom in. also file size depends on resolution. the less resolution is the less file size is. and vice versa.
try to use xsyze & ysize default values at the beginning, please.
i am waiting your results.
hi,
ok, i have tried to use xsyze & ysize default values and i have the same result. i have a empty file. i don´t know to do.
quote:
originally posted by gabriel
have you the same result with odamfcapp? no.
did you launch odamfcapp with success? or you didn't launch odamfcapp?
misha kuzinets
example dwg.
quote:
originally posted by misha kuzinets
did you launch odamfcapp with success? or you didn't launch odamfcapp?
hi.
i send you a dwg file which i load to odamfcapp and i export to dwf file and i see nothing.
i hope your answer.
thank you.
attached files (9.8 kb, 3 views)

gabriel,
i have looked at your file. the result of export to dwf your file (model space) is 'empty'. both autocad and odamfcapp (sample application based on dwgdirect) have the same result. the 'empty' means that file keeps some auxiliary information as creator, namedview, view opcodes and etc. but there is no any exported geometry entity there. the result of drawing of model space is empty. that is why the viewport in your file is not correct. every entity is so tiny little with this vport that anything can not be drawn.
for instance, if you clicked zoom extents for odamfcapp (viewport is corrected at it) everything is ok!
misha kuzinets
new code
quote:
originally posted by misha kuzinets
gabriel,
i have looked at your file. the result of export to dwf your file (model space) is 'empty'. both autocad and odamfcapp (sample application based on dwgdirect) have the same result. the 'empty' means that file keeps some auxiliary information as creator, namedview, view opcodes and etc. but there is no any exported geometry entity there. the result of drawing of model space is empty. that is why the viewport in your file is not correct. every entity is so tiny little with this vport that anything can not be drawn.
for instance, if you clicked zoom extents for odamfcapp (viewport is corrected at it) everything is ok!
this is my new code:
code:
void export_dwf_database(
oddbdatabaseptr database,
const char *namefile)
{
dwexportparams params;
oddbviewtableptr pvptbl;
oddbobjectid id;
oddbviewporttablerecordpt prec;
// new code.
pvptbl = database->getviewporttableid().safeopenobject();
id = pvptbl->getactiveviewportid();
prec = id.safeopenobject(oddb::kforwrite);
prec->zoomextends();
params.pdb = database;
params.sdwffilename = odstring(namefile);
params.binkedarea = false;
params.bcolormapoptimize = false;
params.format = dw_ascii;
params.version = ndwf_v42;
try
{
exportdwf(params);
}
catch(oderror error)
{
int code;
code = error.code();
}
}
but i see nothing. what am i making bad?
thank you.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】cylinder height from sat forma yang686526 DirectDWG 0 2009-05-04 06:56 PM
【转帖】chinese characters lost when converting to older dwg forma yang686526 DirectDWG 0 2009-05-04 05:45 PM
【转帖】autocad 2010 forma yang686526 DirectDWG 0 2009-05-04 04:27 PM
【转帖】add xdata to some entity cant be save in dwg forma yang686526 DirectDWG 0 2009-05-04 03:42 PM
【转帖】drawing forma yang686526 American standards 0 2009-04-29 07:44 PM


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


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