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

yang686526 2009-05-06 07:50 PM

【转帖】oddblayertablerecordptr color index exception
 
oddblayertablerecordptr color index exception
oddblayertablerecordptr color index exception
hi
i'm having problems setting the color index of a layer. the code below throws an "invalid input" exception with an input of 0 for the colorindex.
what am i doing wrong here? i have a feeling i have to set the color model, but can't see from the api docs how this is done.
thanks
peter.
/////////////////////////////////////////////////////
// add a new layer to the drawing
oddblayertableptr ptrlayers;
oddblayertablerecordptr ptrlayer;
/ptrlayers = ptrdb->getlayertableid().safeopenobject(oddb::kforwrite) ;
ptrlayer = oddblayertablerecord::createobject();
// name must be set before a table object is added to a table.
ptrlayer->setname(strlayername);
ptrlayer->setcolorindex(0); // <-- throws "invalid input" exception.
// add the object to the table.
return ptrlayers->add(ptrlayer);
///////////////////////////////////////////////
color index 0 means byblock.
layer's color can't be set to byblock or bylayer.
sergey slezkin


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