![]() |
【转帖】exporting dwg layouts to dwf problem
exporting dwg layouts to dwf problem
exporting dwg layouts to dwf problem after exporting dwg layouts to dwf, same entities appear in each dwf layout, although in the dwg file the layout contents are different. tried using the publish feature in the odamfcapp but it gave the same result. with dwgdirect c++ 1.13, used the following code: params.format = dw_ascii; params.version = ndwf_v60; oddbobjectid ldictid = this->getlayoutdictionaryid(); oddbdictionaryptr pdic = ldictid.safeopenobject(oddb::kforwrite); dwfpagedata pagedata; int nnumentries = pdic->numentries(); if (nnumentries > 0) { // get a dictionary iterator. oddbdictionaryiteratorptr piter = pdic->newiterator(); for (; !piter->done(); piter->next()) { dwfpagedata pagedata; odstring slayoutname = piter->name(); pagedata.slayout = slayoutname; params.arpagedata.append(pagedata); } } you can look at the code in publishfiledlg.cpp and odamfcappdoc from odamfcapp sample where publish call was implemented. misha kuzinets quote: originally posted by misha kuzinets you can look at the code in publishfiledlg.cpp and odamfcappdoc from odamfcapp sample where publish call was implemented. i have the same problem with odamfcapp publish feature. same entities exported in each layout in dwf. located the code the publishfiledlg.cpp: void cpublishsheets::onok() { updatedata(); // true - data is being retrieved // process getting data if (m_sfilename.find(".dwf") == -1) { m_sfilename += ".dwf"; } m_pparams->sdwffilename = m_sfilename; switch (m_radioformat) { case enbinary: m_pparams->format = dw_uncompressed_binary; m_pparams->version = ndwf_v60; break; case enascii: m_pparams->format = dw_ascii; m_pparams->version = ndwf_v60; break; default: oda_assert(false); } //m_pparams->spassword = m_spassword; // to add page stuff if there is... for (uint i = 0; i < m_arpagedata.size(); i++) { dwfpagedata pagedata = m_arpagedata[i]; m_pparams->arpagedata.append(pagedata); } please, send a source and result (dwg & dwf) files. misha kuzinets attached dwf & dwg file. attached files (57.6 kb, 5 views) quote: originally posted by marc attached dwf & dwg file. you are exporting lines layout every time. you can use odamfcappdll for publishing and look at a correct result. misha kuzinets the attached dwf file was created using odamfcapp (dwg direct 1.13), using the default publish options. therefore there may a bug in the odamfcapp? i tried with odamfcappdll and i get the following error message: "unexpected error is happened during exportdwf." the file published correctly for you? don't know why it's not working here. any other other suggestions are welcome. i guess you know dwf 6.0 file is a package. i've found out that in your dwf file every layout references to the same geometry file. 'descriptor.xml' for every layout keeps the same ' title="marcus~1.w2d" ' property. it is a fault. every new temporary geometry file erases previous one. the name should be unique in package. i think the problem is in unique name generation. what environment do you use? under _win32 the functions as gettemppath() and gettempfilename() are used for unique filename creation. misha kuzinets i am running the the odamfcapp under windows 2000 professional. thanks that has given a few clues. i'll see if i can debug the dwf export source. there is a problem with the dwf layout export in windows 2000. only the current layout is exported to dwf when there is "." in the temp file name path. i checked the temp file name on my computer and it was set to: c:\documents and settings\marc.office\temp\ the dd_dwfexport.lib returns the wrong filename from this path. see dwfexportimpl.cpp function: gettempfile line: sfilename = stmpfilename.left( stmpfilename.find('.') ); as a work around i changed the temp & tmp environment variables on my computer from: %userprofile%\local settings\temp %userprofile%\local settings\tmp to c:\tmp\ c:\temp\ after the change i could publish all layouts to a single dwf file. |
所有的时间均为北京时间。 现在的时间是 03:42 PM. |