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

problem in dwf import
problem in dwf import
hi,
i m using dwgdirect 1.14.02.00, i m facing a problem in importing the dwf file, using this code
pmodule = :drxdynamiclinker()->loadmodule("dd_dwf7import.drx");
hmodule hmodule = reinterpret_cast<hmodule>(pmodule->sysdata());
if(hmodule)
{
typedef oddwfimportptr (*pimporterfactory) ();
if ( pimporterfactory importerfac = (pimporterfactory)getprocaddress( hmodule,
"?createimporter@@ya?av?$odsmartptr@voddwfimport@@ @@xz" ) )
importer = importerfac();
}
#endif
#if _toolkit_in_dll_ || _msc_ver < 1300
oddwfimportptr pimporter = createimporter();
{
m_breadingdwf = true;
odrxobjectptr pt=null;
importresult pres;
oddbdatabaseptr pdb;
odstaticrxobject<myservices> svcs;
odinitialize(&svcs);
pdb = svcs.createdatabase();
pt=importer->properties()->putat("database", pdb);
pt=importer->properties()->putat("dwfpath", odrxvariantvalue(odstring(filename)));
pt=importer->properties()->putat("password", odrxvariantvalue(odstring("")));
pt=importer->properties()->putat("paperwidth", odrxvariantvalue(297.0));
pt=importer->properties()->putat("paperheight", odrxvariantvalue(210.0));
pt=importer->properties()->putat( "preservecolorindices", odrxvariantvalue( true ) );
importer->properties()->putat( "layoutnumber", odrxvariantvalue(odint32(-1)) );
importer->properties()->putat( "importw3d", odrxvariantvalue(true) );
pres = (importresult)importer->import();
////////////////////////////////////////////////////////////////////////////////
/////////////
import() function returns with a success,
but database ptr remain empty.......no entities are loaded in it......
is there any specific drx that causes this problem, that i forget to link, or anything i needed to do in the code to get it done............
thanks
mani
last edited by cad-mind; 13th november 2006 at 12:34 amfff">.
for me the code is right.maybe all data are set into paperspace. try to post the file.
nope......i create a new file all entities in model space....
export it as dwf (it export it... fine).........then try to import it............
this import function excutes successfully........but then db pointer remains empty......
when you export have you tried to set version "binary dwf v5.5" or version more older? have you obtain the same result when you import? if you open the file with autodesk dwf viewer can you see right the file?
yeah....i do
autocad dwf viewer display the file absolutly fine.....
the thread with title "import dwf in dwgdirect 2.0.03" maybe it can help you.
can you read the file in attach?
attached files (2.0 kb, 14 views)

same as others.......import ends up with success but db pointer still empty
i have the some problem if i use release version of dll. can you try to use debug version?
well....sry, but it is not working still.....
r u using the same version 1.14.02
now i am using 2.1 version, but it is the same when i use 1.14.03 1.14.02 and 1.14.01. code work fine if use 1.13. i use visual c++ 6.0. i see odamfcappdll.exe work fine. it is the same with your dwf file?
try to add reactor to database. see if it is called.
(look at e.g. odamfcappdoc.cpp, 200 - 230)
vladimir
in debug version there isn't problem to read dwf file so the trace i think it is not util.
reactor may print debug message to file, not to debug window.
are you also having problems with import? (you did not specify what problems)
vladimir
yes i do. i don't read dwf file in release version when they are "binary dwf v6.0" or "zipped ascii enc.2d st.v6.0". the code is like above.
i tried to use reactor. i add to my code
class tracedbreactor : public odstaticrxobject<oddbdatabasereactor>
{
public:
void objectappended(const oddbdatabase* /*pdb*/, const oddbobject* pobj)
{
oda_trace2("<objectappended : %s, %s>\n", pobj->isa()->name().c_str(), pobj->objectid().gethandle().ascii().c_str());
}
.....
....
}
}
g_tracedb
into my database i add pdb->addreactor(&g_tracedb);
how i can do to write the trace route into file?
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】export to dwf v6.0 not working in oddwfexportex - dd rel 2.2 yang686526 DirectDWG 0 2009-05-05 10:27 AM
【转帖】dwf roundtip export and impor yang686526 DirectDWG 0 2009-05-05 07:53 AM
【转帖】dwf printing problems yang686526 DirectDWG 0 2009-05-05 07:51 AM
【转帖】dwf impor yang686526 DirectDWG 0 2009-05-05 07:48 AM
【转帖】dwf export problem yang686526 DirectDWG 0 2009-05-04 08:19 PM


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


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