几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】parsing colors in version 1.5 (http://www.dimcax.com/hust/showthread.php?t=17850)

yang686526 2009-05-06 09:41 PM

【转帖】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


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