高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
|