查看单个帖子
旧 2009-05-06, 09:41 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】parsing colors in version 1.5

parsing colors in version 1.5
parsing colors in version 1.5
i just installed version 1.5 of directdwg. in this version the class odcmcolor does not exist any more. i used the member isbycolor to test if the color of an entity is definied by its layer; how can i get the same result with the new version?

odcmcolor method is to be redesigned since entity in ac 2004 may have not only aci (color index) but rgb color too.
in previous version rgb-related functionality was not implemented (isbycolor() method determines if color is set by rgb). probably you used isbylayer() method.
until new odcmcolor is implemented supporting new ac2004 features you can simply check the value of color index: 0-byblock, 256-bylayer.
sergey slezkin

in case of 0 (by block) which is the way to read color data from the block?
there is not any method to retreive color using oddbblockreference class

oddbblockreference class is oddbentity inheritor. so it has colorindex() method.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)