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

two layers with same name in file
two layers with same name in file
hi,
i noticed a error in dwgdirect library, version 1.10 updated. while opening a dxf file containing two layers, both with the same name, application crashes. acad opens the same file normally keeping only one layer.
will you sove this error, or will consider a error in file?
regards,
regina keller.
surely such files are incorrect but dd 1.11 will give warning while opening such files in open mode and report fixed error in recover mode.
sergey slezkin
still having problems
hi sergey,
i updated library to 1.11 version and problem still happening.
was problem really solved?
i'm using c++builder 6. i noticed that geoff briggs is having the same problem in thread "problems with borland builder 6".
i'm using the code bellow and program doens't stop in catch and a exception is raised.
i'm attaching a file with problem.
regards,
regina.
code:
try
{
// create a database and load the drawing into it.
oddbdatabaseptr pdb = svcs.readfile(
filename,
false,
false,
oda::ksharedenyno
);

if (!pdb.isnull()) {
sbuffer.init();
sbuffer << "file version: " << pdb->originalfileversion() << ends;
strings->add(buffer);
dbdumper dumper;
dumper.dump(pdb, &svcs, strings);
}
}
catch (oderror& e) {
sbuffer.init();
sbuffer << "dwgdirect error: " << svcs.geterrordescription(e.code()).c_str() << ends;
strings->add(buffer);
}
catch (...) {
sbuffer.init();
sbuffer << "unknown error." << ends;
strings->add(buffer);
}
attached files (1.6 kb, 4 views)

the problem seems to bc6 specific.
while loading dxf file table entries are added using:
code:
try
{
add(pentry);
}
catch (oderror & err)
{
switch (err.code())
{
case eduplicaterecordname:
.....
if a duplicate record ocurs in file exception thrown from add() is handled inside dd.
probably for some reason it is not handled in bc6.
we already saw such strange behavior: exception thrown from conditional expression was not handled and it was ok after we replaced conditional expression with if-else :
code:
// exception thrown from func1() is not handled
try {
someptr = (expression) ? func1() : func2();
}
catch
// works:
try {
if (condition)
{
someptr = func1();
}
else
{
someptr = func2();
}
}
catch
sergey slezkin
exceptions not handled in bc6
hi sergey,
i think the problem is really in bc6. i tried enable the 'stop in c++ exceptions' and app stoped with oderro_duplicaterecordname exception. (menu: tools-> debugger options-> language exceptions)
exception is raised, but not catched by try\catch(...). there is another way to handle this exception or any other that can be throwed?
i noticed that in the code bellow exceptions also aren't catched.
code:
void abcd(
bool exc
) throw()
{
if (exc)
throw 1234;
}
main()
{
try {
abcd(true);
}
catch(...) {
// any code, that never is executed
}
}
regards,
regina keller

hi regina,
the changes fixed bug with duplicaterecordname were next:
code:
// in case of using:
// throw oderror_duplicaterecordname(pimpl->m_items[*iter].getval());
// bb6 throws unhandled exception
oddbobjectid id = pimpl->m_items[*iter].getval();
throw oderror_duplicaterecordname(id);
suggestions why bb6 throws unhandled exception in first case (getval() returns const oddbobjectid&) will be appreciated
the fix will be available in 1.11 update (as i know it is planed for next week).
as regards your last example, an empty exception specification implies a function throws no exceptions:
void f() throw()
{
// ... function throws no exceptions ...
}
vc6/7 handle exceptions anyway, but bb6 generates unhandled exception. bb6 will work correctly if you remove throw() exception specification.
regards,
sergey vishnevetsky
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】losing objects when writing dwg file yang686526 DirectDWG 1 2011-11-24 02:10 AM
【转帖】obtain single sat file for all proxy enitites yang686526 DirectDWG 0 2009-05-06 06:47 PM
【转帖】different vectorization of same file on windows and mac yang686526 DirectDWG 0 2009-05-04 07:29 PM
【转帖】creating a sat file out of dxf solid file yang686526 DirectDWG 0 2009-05-04 06:47 PM


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


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