![]() |
【转帖】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. |
所有的时间均为北京时间。 现在的时间是 12:43 PM. |