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

problem with purging layers
problem with purging layers
i haven't used the purge feature in dwgdirect before, so i have had a go with this program i am writing.
i extracted some code from the examples provided with dwgdirect:
code:
// purges any unused layers from the passed in database
void cdgn2dwgdlg:urgelayers(oddbdatabase *pdb)
{
assert( pdb != null );
if( pdb != null )
{
oddbsymboltableptr ptable;
oddbobjectidarray idarray;
// get the layer table
ptable = pdb->getlayertableid().openobject();
// iterate the layers, getting their id values and
// storing them into our id array
oddbsymboltableiteratorptr iter = ptable->newiterator();
for( iter->start(); !iter->done(); iter->step() )
{
idarray.push_back( iter->getrecordid() );
}

// now purge this array, so that only the layers that
// need purging are left in the array
pdb->purge( idarray );
oddbobjectptr pobj;
uint i;
oddbobjectid *pid = idarray.begin();
// iterate the array and erase the unused layers
for( i = idarray.size(); i > 0; i--, pid++ )
{
pobj = pid->openobject( oddb::kforwrite );
if( !pobj.isnull() )
{
pobj->erase();
}
}
}
}
but when i run this, my resulting files, dwg or dxf will not open in autocad, saying that polylines refer to layers not found in the drawing.
why is this?
andrew
probably you are using 1.09? purge bug was fixed before 1.10 release.
sergey slezkin
yes, i think i am using 1.09. is this 1.10 ready yet then? or do i have to re-download 1.09 libraries?
andrew
quote:
originally posted by sergey slezkin
probably you are using 1.09? purge bug was fixed before 1.10 release.
i just downloaded version 1.10 and have tried doing a full recompile with it.. i get these errors:
code:
deleting intermediate files and output files for project 'dgn2dwg - win32 release'.
deleting intermediate files and output files for project 'dgn2dwg - win32 debug'.
--------------------configuration: dgn2dwg - win32 release--------------------
compiling resources...
compiling...
stdafx.cpp
compiling...
dgn2dwg.cpp
c:\my programs\dgn2dwg\dgn2dwg.cpp(34) : error c2385: 'cdgn2dwgapp::delete' is ambiguous
c:\my programs\dgn2dwg\dgn2dwg.cpp(34) : warning c4385: could be the 'delete' in base 'cobject' of base 'ccmdtarget' of base 'cwinthread' of base 'cwinapp' of class 'cdgn2dwgapp'
c:\my programs\dgn2dwg\dgn2dwg.cpp(34) : warning c4385: or the 'delete' in base 'odrxobject' of base 'oddbhostappservices' of base 'exhostappservices' of class 'cdgn2dwgapp'
c:\my programs\dgn2dwg\dgn2dwg.cpp(34) : warning c4385: or the 'delete' in base 'odrxobject' of base 'oddbsystemservices' of base 'exsystemservices' of class 'cdgn2dwgapp'
c:\my programs\dgn2dwg\dgn2dwg.cpp(113) : error c2248: 'new' : cannot access protected member declared in class 'exgsbitmapdevicebase<class exgsgdidevice>'
c:\dwgdirect\exrender\exgsbitmapdevice.h(94) : see declaration of 'new'
c:\my programs\dgn2dwg\dgn2dwg.cpp(113) : error c2248: 'delete' : cannot access protected member declared in class 'exgsbitmapdevicebase<class exgsgdidevice>'
c:\dwgdirect\include\rxobject.h(453) : see declaration of 'delete'
dgn2dwgdlg.cpp
dibstatic.cpp
filtertabledlg.cpp
gridcell.cpp
gridcellbase.cpp
gridctrl.cpp
griddroptarget.cpp
inplaceedit.cpp
pathdialog.cpp
previewdib.cpp
previewfiledlg.cpp
titletip.cpp
warningsdlg.cpp
generating code...
error executing cl.exe.
dgn2dwg.exe - 3 error(s), 3 warning(s)
--------------------configuration: dgn2dwg - win32 debug--------------------
compiling resources...
compiling...
stdafx.cpp
compiling...
dgn2dwg.cpp
c:\my programs\dgn2dwg\dgn2dwg.cpp(34) : error c2385: 'cdgn2dwgapp::delete' is ambiguous
c:\my programs\dgn2dwg\dgn2dwg.cpp(34) : warning c4385: could be the 'delete' in base 'cobject' of base 'ccmdtarget' of base 'cwinthread' of base 'cwinapp' of class 'cdgn2dwgapp'
c:\my programs\dgn2dwg\dgn2dwg.cpp(34) : warning c4385: or the 'delete' in base 'odrxobject' of base 'oddbhostappservices' of base 'exhostappservices' of class 'cdgn2dwgapp'
c:\my programs\dgn2dwg\dgn2dwg.cpp(34) : warning c4385: or the 'delete' in base 'odrxobject' of base 'oddbsystemservices' of base 'exsystemservices' of class 'cdgn2dwgapp'
c:\my programs\dgn2dwg\dgn2dwg.cpp(113) : error c2660: 'new' : function does not take 4 parameters
dgn2dwgdlg.cpp
dibstatic.cpp
filtertabledlg.cpp
gridcell.cpp
gridcellbase.cpp
gridctrl.cpp
griddroptarget.cpp
inplaceedit.cpp
pathdialog.cpp
previewdib.cpp
previewfiledlg.cpp
titletip.cpp
warningsdlg.cpp
generating code...
error executing cl.exe.
dgn2dwg.exe - 2 error(s), 3 warning(s)
why should i suddenly get these compile errors changing from 1.09 to 1.10 libraries?
andrew
classes that are multiply inherited from odrxobject now need to specify which new and delete to use, for example in odwriteex.cpp:
class myservices : public exsystemservices, public exhostappservices
{
protected:
using exsystemserviceserator new;
using exsystemserviceserator delete;
};
compile errors will result if these "using" declarations are not added.
this is extracted from release notes in dd 1.10 help.
best regards.
ok, i added those two protected members into my app class, since that is where the services class was inherited from, and now i get these errors:
code:
vertcheck.cpp
c:\my programs\vertcheck\vertcheck.cpp(710) : error c2248: 'new' : cannot access protected member declared in class 'exgsbitmapdevicebase<class exgsgdidevice>'
c:\dwgdirect\exrender\exgsbitmapdevice.h(94) : see declaration of 'new'
c:\my programs\vertcheck\vertcheck.cpp(710) : error c2248: 'delete' : cannot access protected member declared in class 'exgsbitmapdevicebase<class exgsgdidevice>'
c:\dwgdirect\include\rxobject.h(453) : see declaration of 'delete'
vertcheckdlg.cpp
c:\my programs\vertcheck\vertcheckdlg.cpp(1475) : error c2039: 'settdcreate' : is not a member of 'oddbdatabase'
c:\dwgdirect\include\dbdatabase.h(122) : see declaration of 'oddbdatabase'
c:\my programs\vertcheck\vertcheckdlg.cpp(1476) : error c2039: 'settdupdate' : is not a member of 'oddbdatabase'
c:\dwgdirect\include\dbdatabase.h(122) : see declaration of 'oddbdatabase'
error executing cl.exe.
vertcheck.exe - 4 error(s), 0 warning(s)
1. first 2 errors: odrxobjects should be created by createobject() function not by "new" operator:
code:
odgsdeviceptr pdev = 'exgsbitmapdevicebase<class exgsgdidevice>::createobject();
2. methods modifying database read-only variables are removed.
global functions are added (at the end of dbdatabase.h) to allow modification of "read-only" variable as a hack like:
code:
toolkit_export void oddbsettdupdate(oddbdatabase&pdb, oddbdate date);
sergey slezkin
ok, i have revised my method:
code:
// this will generate a bitmap preview for us using dwg direct.
odgsdeviceptr cvertcheckapp::gsbitmapdevice()
{
odgsdeviceptr pdevice;
pdevice = exgsbitmapdevicebase<class exgsgdidevice>::createobject();
// pdevice.attach( new odrxobjectimpl<exgsbitmapdevice<exgsgdidevice> > );
return pdevice;
}
and now i get these errors:
code:
vertcheck.cpp
c:\my programs\vertcheck\vertcheck.cpp(710) : error c2385: 'exgsbitmapdevicebase<class exgsgdidevice>::createobject' is ambiguous
c:\my programs\vertcheck\vertcheck.cpp(710) : warning c4385: could be the 'createobject' in base 'odgirasterimage' of class 'exgsbitmapdevicebase<class exgsgdidevice>'
c:\my programs\vertcheck\vertcheck.cpp(710) : warning c4385: or the 'createobject' in base 'exgsgdidevice' of class 'exgsbitmapdevicebase<class exgsgdidevice>'
concerning the datecreation, i can cremove my code if those values are set correctly by the dwgdirect system when the new dwg files is created. i assumed they needed setting...
andrew
sorry, should be:
code:--------------------------------------------------------------------------------
odgsdeviceptr pdev = 'exgsbitmapdevice<class exgsgdidevice>::createobject();
--------------------------------------------------------------------------------
(without "base")
sergey slezkin
i think i will stick with 1.09! i now get this stuff:
code:
linking...
exgsbitmapdevice.obj : error lnk2001: unresolved external symbol "public: static class odrxobjectptr __cdecl odexgirasterimage:seudoconstructor(void)" (?pseudoconstructor@odexgirasterimage@@sa?avodrxobjectptr@@xz)
[snip]
error executing link.exe.
vertcheck.exe - 1325 error(s), 0 warning(s)
ok, at this point i can say i'm rebuilding my project with dd 1.10 and i have obtained very similar errors while linking:
linking...
exgsbitmapdevice.obj : error lnk2001: unresolved external symbol "public: static class odrxobjectptr __cdecl odexgirasterimage:seudoconstructor(void)" (?pseudoconstructor@odexgirasterimage@@sa?avodrxob jectptr@@xz)
exgsgdidevice.obj : error lnk2001: unresolved external symbol "public: static class odrxobjectptr __cdecl odexgirasterimage:seudoconstructor(void)" (?pseudoconstructor@odexgirasterimage@@sa?avodrxob jectptr@@xz)
exgsopengldevice.obj : error lnk2001: unresolved external symbol "public: static class odrxobjectptr __cdecl odexgirasterimage:seudoconstructor(void)" (?pseudoconstructor@odexgirasterimage@@sa?avodrxob jectptr@@xz)
..
..
..
..
..
debug/datosforjadosb.exe : fatal error lnk1120: 30 unresolved externals
error executing link.exe.
creating browse info file...
datosforjadosb.exe - 36 error(s), 0 warning(s)
example devices you used in your project (like exgsbitmapdevice)require linking with exgirasterimage.cpp (examples/exservices)
sergey slezkin
even adding that, i get loads of errors.
for example:
lved external symbol "public: virtual void __thiscall odgismartdrawobject::getstereoparameters(double &,double &)const " (?getstereoparameters@odgismartdrawobject@@ubexaan 0@z)
dd_vc6mt_gs.lib(gsbase.obj) : error lnk2001: unresolved external symbol "public: virtual void __thiscall odgismartdrawobject::getstereoparameters(double &,double &)const " (?getstereoparameters@odgismartdrawobject@@ubexaan 0@z)
exgsgdidevice.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall odgismartdrawobject::setstereoparameters(double,do uble)" (?setstereoparameters@odgismartdrawobject@@uaexnn@ z)
dd_vc6mt_gs.lib(gsbase.obj) : error lnk200
i simply don't understand why moving from 1.09 to 1.10 should give me thid headache, all for just a purging layers bug fix.
can you not provide an abc list of changes required, since there are evidently several additions needed that just what the chm file says..
are you sure you are linking with dd_vc6mt_gi.lib?
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】message from modeless box, toggle layers yang686526 DirectDWG 0 2009-05-06 05:45 PM
【转帖】layers in xref yang686526 DirectDWG 0 2009-05-06 04:39 PM
【转帖】frozen layers in viewpor yang686526 DirectDWG 0 2009-05-05 11:08 AM
【转帖】dwgdirect fails to load correct layers yang686526 DirectDWG 0 2009-05-05 08:32 AM
【转帖】components on layers yang686526 SolidWorks二次开发 0 2009-04-13 09:49 AM


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


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