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

color conversion problem dd 1.14.01
color conversion problem dd 1.14.01
hi
i'm using dwgdirect libraries 1.14.01 in my application.
when i write a dwg/dxf file containing entities with different colours (set using oddbentity::setcolour), it seems all ok, and intellicad reads all the entities, each with its colour.
but when i try to read this file with my application, i get back for all the entities the same colour of the first entity found in the database.
when i was using dd 1.13 in my application (that hasn't been changed) this problem didn't happen.
is it a bug of dd 1.14.01?
thanks in advance
could you post a sample file and a piece of your code extracting the color of entities?
sergey slezkin
samples for color conversion
attached you'll find the sample code and the colors.dwg file written using the writeentity function.
when reading the file i use the getentitycolor, that returns the same color for all the lines of the drawing.
thanks
attached files (4.8 kb, 10 views)

i would try to set
unsigned char red = 255;
unsigned char green = 0;
unsigned char blue = 0;
since intellicad displays your file with correct colors the problem is not in your writing code but in your reading code.
so i asked for code sample which gets color from entity.
btw, odamfcapp sample displays your entities with different colors.
sergey slezkin
when i read colors.dwg i have same problem. some color line are read like "isbyaci()" with colorindex=9 (same layer's number?!?) and some like "isbycolor()" but when i extract rgb obtain r,g,b=192,192,192.
can the problem to be linked at the file's version (ac1015)?
i tried with unsigned char, but nothing changed.
i recovered a backup of my application that used dd version 13 and i wrote the same file with both the old (colors_ver_13.dwg using dd version 13) and the new (colors_ver_14.dwg using dd version 14) application.
when i read the colors_version_13.dwg file, my getentitycolor function (whose sample code was reported in sample.zip in the previous post) returns the correct colors.
note: my getentitycolor function'code hasn't been changed.
i opened both files with odamfcapp, and i noticed that in colors_ver_14.dwg, starting from the second acdbline, a hardpointer 70:acdbcolor appears that neither in the first acdbline in colors_ver_14.dwg,
nor in all the acdblines in colors_ver_13.dwg appears.
best regards
attached files (8.3 kb, 5 views)

can you try to export in dwg format 2005 (ac1015) ? i think in this format read/write is ok. i think there is a problem when we read file older than 2005 and they are create with:
color.setcolormethod(odcmentitycolor::kbycolor);
color.setrgb(red, green, blue);
oddblineptr->setcolor(color);
as you already pointed out the problem is with round-tripping rgb colors in pre-ac2004 file versions.
this is dd bug. sorry.
sergey slezkin
as i know that the problem isn't me, i feel better!!!
now i only have to anxiously wait for the bug fix.
many thanks to everybody!!
1.14.02 also
hi,
i have just updated to the new dd version and i'm also not able to read correctly the color (rgb) of entities in r13, r14, 2000 while it works correctly in r12 and 2004. the problem seems with the dd reader, since the colors of the files read with autocad are correct.
is the issue be corrected soon?
the fix will be available in next release/update which is scheduled yet.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】cannot open a dwg file in autocad - random problem yang686526 DirectDWG 0 2009-05-04 05:28 PM
【转帖】a problem about odamfcapp.exe yang686526 DirectDWG 0 2009-05-04 03:10 PM
【转帖】a diameteric dimension problem when exploding yang686526 DirectDWG 0 2009-05-04 03:05 PM
【转帖】vista and addin dll problem yang686526 SolidWorks二次开发 0 2009-04-13 03:19 PM
【转帖】pdm problem yang686526 SolidWorks二次开发 0 2009-04-13 01:20 PM


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


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