几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】exception in odcmcolorsetcolorindex90 (http://www.dimcax.com/hust/showthread.php?t=16146)

yang686526 2009-05-05 09:58 AM

【转帖】exception in odcmcolorsetcolorindex90
 
exception in odcmcolor::setcolorindex()
exception in odcmcolor::setcolorindex()
hi,
the documentation of odcmcolor::setcolorindex() states that the acceptable values for the colorindex parameter are 0-257 (it takes a oduint16 parameter).
however when i pass 257, einvalidinput exception is thrown. am wriring:
code:
odcmcolor odcolor;
oduint16 index = getcolorindex(); // this gets the index based on the color in the app
odcolor.setcolorindex(index);
when index == 257, only then this exception is thrown.
interestingly, odcmcolor::colorindex() method returns a oduint8 (hence limiting its range to 0-256).
should i handle the case of 257 (odcmentitycolor::kacinone) separately?
thanks
i think that since setcolorindex() accepts bylayer index = 256 it should accept 257 (none) too.
but if the index is set to byblock, bylayer (or none).
getcolormethod() will return not byaci but byblock/bylayer/none.
if color method is byaci uint8 is enough for valid indices 1-255.
sergey slezkin
so for index == 257(none), i should handle the case separately?
'coz as of now, the code:
code:
odcmcolor color;
color.setcolorindex(257);
throws an exception, despite 257 being a valid index(odcmentitycolor::kacinone)
thanks


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